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 |
6 | my $ARCH = "/root/devel/cvs/cf.schmorp.de/arch"; |
6 | my $ARCH = "/root/src/cf.schmorp.de/arch"; |
7 | |
7 | |
8 | use strict; |
8 | use strict; |
9 | |
9 | |
10 | use Storable; |
10 | use Storable; |
11 | use Pod::POM; |
11 | use 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 | |
201 | my %wiki; |
213 | my %wiki; |
202 | |
214 | |
203 | sub add_node($) { |
215 | sub add_node($) { |
204 | my ($node) = @_; |
216 | my ($node) = @_; |