version 1.4 | | version 1.5 |
---|
| | |
} | | } |
# return table containing all objects in the map | | # return table containing all objects in the map |
sub readmap { | | sub readmap { |
local ($m); | | my ($m); |
| | my($last); |
| | my($parent); |
$last = ""; | | $last = ""; |
$parent = ""; | | $parent = ""; |
| | |
| | |
} | | } |
$_ = <IN>; | | $_ = <IN>; |
if (! /^arch map$/) { | | if (! /^arch map$/) { |
print "Error: file $file isn't mapfile.\n"; | | # print "Error: file $file isn't mapfile.\n"; |
return; | | return; |
} | | } |
if ($VERBOSE) { | | if ($VERBOSE) { |
| | |
if (($m = (@_ = /^arch \S+\s*$/g)) > 1) { | | if (($m = (@_ = /^arch \S+\s*$/g)) > 1) { |
$parent = /^arch (\S+)\s*$/; | | $parent = /^arch (\S+)\s*$/; |
# object has inventory | | # object has inventory |
local ($inv) = $_; | | my ($inv) = $_; |
while (<IN>) { | | while (<IN>) { |
if (/((.|\n)*end\n)(arch (.|\n)*\nend\n)/) { | | if (/((.|\n)*end\n)(arch (.|\n)*\nend\n)/) { |
&check_obj ("$inv$1"); | | &check_obj ("$inv$1"); |
| | |
} elsif (/^end$/) { | | } elsif (/^end$/) { |
&check_obj ("$inv$_"); | | &check_obj ("$inv$_"); |
} else { | | } else { |
if ($printmap) { print "$mapname"; $printmap=0;} | | # if ($printmap) { print "$mapname"; $printmap=0;} |
print " Error: Corrupted map file $file.\nSegment:\n$_\nLine: $.\n"; | | # This doesn't work right - it gets confused when objects are within |
| | # another object |
| | # print " Error: Corrupted map file $file.\nSegment:\n$_\nLine: $.\n"; |
} | | } |
} | | } |
$parent=""; | | $parent=""; |
} elsif (/^More$/ || $m == 1) { | | } elsif (/^More$/ || $m == 1) { |
&check_obj ($_); | | &check_obj ($_); |
} else { | | } else { |
if ($printmap) { print "$mapname"; $printmap=0;} | | # if ($printmap) { print "$mapname"; $printmap=0;} |
print " Error: Corrupted map file $file.\nSegment:\n$_\nLine: $.\n"; | | # print " Error: Corrupted map file $file.\nSegment:\n$_\nLine: $.\n"; |
} | | } |
} | | } |
close (IN); | | close (IN); |
| | |
| | |
opendir (DIR , $dir) || die "Can't open directory : $dir\n"; | | opendir (DIR , $dir) || die "Can't open directory : $dir\n"; |
while ($file = readdir (DIR)) { | | while ($file = readdir (DIR)) { |
next if ($file eq "." || $file eq ".." || $file eq "CVS"); | | next if ($file eq "." || $file eq ".." || $file eq "CVS" || $file eq "unlinked" || $file eq "editor"); |
$file = "$dir/$file"; | | $file = "$dir/$file"; |
next if (-l $file); | | next if (-l $file); |
push (@dirs, $file) if (-d $file); | | push (@dirs, $file) if (-d $file); |