ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pod2wiki
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pod2wiki (file contents):
Revision 1.17 by root, Wed Apr 2 13:27:55 2008 UTC vs.
Revision 1.18 by root, Wed Apr 2 14:42:29 2008 UTC

1#! perl 1#! perl
2 2
3# convert given .pod files to wiki style 3# convert given .pod files to wiki style
4 4
5# base path of arch tree, only used for new arch graphics 5# base path of arch tree, only used for new arch graphics
6my $ARCH = "/root/devel/cvs/cf.schmorp.de/arch"; 6my $ARCH = "/root/src/cf.schmorp.de/arch";
7 7
8use strict; 8use strict;
9 9
10use Storable; 10use Storable;
11use Pod::POM; 11use Pod::POM;
84 84
85 my $text = $1; 85 my $text = $1;
86 86
87 if ($link =~ /http:/) { 87 if ($link =~ /http:/) {
88 "<u>" . (::asxml $link) . "</u>" 88 "<u>" . (::asxml $link) . "</u>"
89 } elsif ($link =~ /^\$ARCH\/(.+)$/) { 89 } elsif ($link =~ /^\$ARCH\/(.+\....)$/) {
90 my $path = $1; 90 my $file = $1;
91 (my $base = $path) =~ s/.*\///; 91
92 -f "$ARCH/$path" && system "rsync -av -c \Q$ARCH/$path\E \Qresources/arch/$base"; 92 unless (-f "resources/arch/$file.png") {
93 print "ARCHIMG $file is missing, trying to supply... ";
94 my ($path) = split /\x00/, qx<find \Q$ARCH\E -name \Q$file.64x64.png*\E -print0>;
95 -f $path or die "$file: could not find arch image";
96 print "$path\n";
97 system "rsync -a \Q$path\E resources/arch/\Q$file.png"
98 and die "rsync failed: $?";
99 system "cvs add -kb resources/arch/\Q$file.png"
100 and ((unlink "resources/arch/$file.png"), die "cvs add failed: $?");
101 }
102
93 ::special image => "arch/$base", 1; 103 ::special image => "arch/$file.png", 1;
94 } else { 104 } else {
95 ::special link => $text, $link 105 ::special link => $text, $link
96 } 106 }
97} 107}
98 108
195 205
196 [grep $_->[P_INDEX] || defined $_->[P_MARKUP], @result] 206 [grep $_->[P_INDEX] || defined $_->[P_MARKUP], @result]
197} 207}
198 208
199############################################################################# 209#############################################################################
210
211$| = 1;
200 212
201my %wiki; 213my %wiki;
202 214
203sub add_node($) { 215sub add_node($) {
204 my ($node) = @_; 216 my ($node) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines