… | |
… | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | # GNU General Public License for more details. |
14 | # GNU General Public License for more details. |
15 | # |
15 | # |
16 | # You should have received a copy of the GNU General Public License |
16 | # You should have received a copy of the GNU General Public License |
17 | # along with gvpe; if not, write to the Free Software |
17 | # along with cfmaps; if not, write to the Free Software |
18 | # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
18 | # Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | |
19 | |
20 | our $VERSION = '1.212'; |
20 | our $VERSION = '1.212'; |
21 | |
21 | |
22 | use Storable; |
22 | use Storable; |
… | |
… | |
36 | |
36 | |
37 | for my $path (@ARGV) { |
37 | for my $path (@ARGV) { |
38 | (my $base = $path) =~ s/\.map//; |
38 | (my $base = $path) =~ s/\.map//; |
39 | # print STDERR "$path\n"; |
39 | # print STDERR "$path\n"; |
40 | |
40 | |
|
|
41 | warn "$base.png\n"; |
41 | if (!-e "$base.png" |
42 | if (!-e "$base.png" |
42 | || !-e "$base.pst" |
43 | || !-e "$base.pst" |
43 | || -M "$base.pst" > -M $path |
44 | || -M "$base.pst" > -M $path |
44 | || -M "$base.png" > -M $path) { |
45 | || -M "$base.png" > -M $path) { |
45 | # regenerate png and metainfo |
46 | # regenerate png and metainfo |
… | |
… | |
50 | if (!-e "$base.xhtml" |
51 | if (!-e "$base.xhtml" |
51 | || -M "$base.xhtml" > -M "$base.pst") { |
52 | || -M "$base.xhtml" > -M "$base.pst") { |
52 | $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; |
53 | $arch ||= Storable::retrieve "$LIBDIR/archetypes.pst"; |
53 | my $meta = Storable::retrieve "$base.pst"; |
54 | my $meta = Storable::retrieve "$base.pst"; |
54 | |
55 | |
55 | open my $fh, ">:utf8", "$path.xhtml" |
56 | open my $fh, ">:utf8", "$base.xhtml" |
56 | or die "$path.xhtml: $!"; |
57 | or die "$base.xhtml: $!"; |
57 | |
58 | |
58 | select $fh; |
59 | select $fh; |
59 | |
60 | |
60 | my $W = $meta->{width} * $T; |
61 | my $W = $meta->{width} * $T; |
61 | my $H = $meta->{height} * $T; |
62 | my $H = $meta->{height} * $T; |
62 | |
63 | |
63 | my $W2 = $W + 600; |
64 | my $W2 = $W + 600; |
64 | |
65 | |
65 | my (@path) = split /\//, $path; |
66 | my (@path) = split /\//, $base; |
66 | |
67 | |
67 | print "<?xml version='1.0' encoding='utf-8'?>", |
68 | print "<?xml version='1.0' encoding='utf-8'?>", |
68 | '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
69 | '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
69 | "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>", |
70 | "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>", |
70 | "<head>", |
71 | "<head>", |