version 1.16 | | version 1.17 |
---|
| | |
| | |
&info("writing ...$archetypes"); | | &info("writing ...$archetypes"); |
open(ARCH,">".$archetypes) || &die("cannot open ".$archetypes); | | open(ARCH,">".$archetypes) || &die("cannot open ".$archetypes); |
&archsOut; | | &archsOut($root); |
close(ARCH); | | close(ARCH); |
| | |
| | |
| | |
| | |
| | |
sub archsOut { | | sub archsOut { |
| | local($dir) = shift; |
| | |
foreach $arch (@archs) { | | foreach $arch (@archs) { |
| | # Assume the filename $arch begins with $dir. Assign the first path |
| | # name component after $dir to $pathto. |
| | if($arch =~ /^\Q$dir\E\/([^\/]+)\/.*[.]arc$/) { |
| | $pathto = $1; |
| | } else { |
| | &warn("cannot determine editor_folder from arch '$arch'"); |
| | $pathto = ""; |
| | } |
open(ARC,$arch) || &die("cannot open ".$arch); | | open(ARC,$arch) || &die("cannot open ".$arch); |
$pathto = $arch; | | |
$pathto =~ s@[^/]*/@@; | | |
$pathto =~ s@[a-z]*/(.*)/.*arc@$1@; | | |
line: while(<ARC>) { | | line: while(<ARC>) { |
chop; | | chop; |
($var,@values) = split; | | ($var,@values) = split; |
| | |
next line; | | next line; |
} | | } |
if ($var eq "end") { | | if ($var eq "end") { |
print ARCH "editor_folder $pathto\n"; | | print ARCH "editor_folder $pathto\n" if $pathto ne ""; |
} | | } |
if ($var eq "visibility") { | | if ($var eq "visibility") { |
$lvis = $values[0]; | | $lvis = $values[0]; |