--- deliantra/Deliantra-Client/bin/pod2wiki 2008/04/02 13:27:55 1.17
+++ deliantra/Deliantra-Client/bin/pod2wiki 2008/04/02 14:42:29 1.18
@@ -3,7 +3,7 @@
# convert given .pod files to wiki style
# base path of arch tree, only used for new arch graphics
-my $ARCH = "/root/devel/cvs/cf.schmorp.de/arch";
+my $ARCH = "/root/src/cf.schmorp.de/arch";
use strict;
@@ -86,11 +86,21 @@
if ($link =~ /http:/) {
"" . (::asxml $link) . ""
- } elsif ($link =~ /^\$ARCH\/(.+)$/) {
- my $path = $1;
- (my $base = $path) =~ s/.*\///;
- -f "$ARCH/$path" && system "rsync -av -c \Q$ARCH/$path\E \Qresources/arch/$base";
- ::special image => "arch/$base", 1;
+ } elsif ($link =~ /^\$ARCH\/(.+\....)$/) {
+ my $file = $1;
+
+ unless (-f "resources/arch/$file.png") {
+ print "ARCHIMG $file is missing, trying to supply... ";
+ my ($path) = split /\x00/, qx;
+ -f $path or die "$file: could not find arch image";
+ print "$path\n";
+ system "rsync -a \Q$path\E resources/arch/\Q$file.png"
+ and die "rsync failed: $?";
+ system "cvs add -kb resources/arch/\Q$file.png"
+ and ((unlink "resources/arch/$file.png"), die "cvs add failed: $?");
+ }
+
+ ::special image => "arch/$file.png", 1;
} else {
::special link => $text, $link
}
@@ -198,6 +208,8 @@
#############################################################################
+$| = 1;
+
my %wiki;
sub add_node($) {