diff options
author | merlin | 2007-12-31 12:13:21 +0000 |
---|---|---|
committer | merlin | 2007-12-31 12:13:21 +0000 |
commit | 0eb9b0551b9ed35069f4465595cef5f80f5c52a6 (patch) | |
tree | 472399dacd797769a6d76c26e21748f63860418a /src | |
parent | 472627edf7dc3705db27365411c750a268be5d47 (diff) | |
download | mtc-0eb9b0551b9ed35069f4465595cef5f80f5c52a6.zip mtc-0eb9b0551b9ed35069f4465595cef5f80f5c52a6.tar.gz mtc-0eb9b0551b9ed35069f4465595cef5f80f5c52a6.tar.bz2 mtc-0eb9b0551b9ed35069f4465595cef5f80f5c52a6.tar.xz |
Modif permettant d'ignorer l'absence d'un fichier svg si la version compilee en zinc du fichier existe (permet entre autre de diffuser le code de l'appli sans diffuser les svg)
Diffstat (limited to 'src')
-rw-r--r-- | src/MTools/SVG/SVGLoader.pm | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/MTools/SVG/SVGLoader.pm b/src/MTools/SVG/SVGLoader.pm index 5075beb..dfce60f 100644 --- a/src/MTools/SVG/SVGLoader.pm +++ b/src/MTools/SVG/SVGLoader.pm @@ -49,36 +49,35 @@ sub load { { my $filename = $1; my $svgfile = Tk::findINC ("$filename.svg"); - if (!defined $svgfile) - { - print STDERR "##### Error undefined file $filename.svg\n"; - } - my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($svgfile); - my ($dev2,$ino2,$mode2,$nlink2,$uid2,$gid2,$rdev2,$size2,$atime2,$mtime2,$ctime2,$blksize2,$blocks2) = (0,0,0,0,0,0,0,0,0,0,0,0,0); - my $filepath = $autogenPath.$filename; - $filepath = "$filepath$ftag.pm"; $filepath =~ s/::/\//g; $filename =~ s/\//::/g; - if(-e $filepath) + if (defined $svgfile) { - ($dev2,$ino2,$mode2,$nlink2,$uid2,$gid2,$rdev2,$size2,$atime2,$mtime2,$ctime2,$blksize2,$blocks2) = stat($filepath); - } - if( $mtime2 < $mtime ) - { - print "Regenarate SVG modified\n"; - my $pack = $filename; - SVG::SVG2zinc::parsefile( - $svgfile, - "PerlClass", - -out => "$autogenPath$filename$ftag.pm", - -verbose => 0, - -render => 1, - -namespace => 0, - -target => $tag - ); +# print STDERR "##### Error undefined file $filename.svg\n"; + my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($svgfile); + my ($dev2,$ino2,$mode2,$nlink2,$uid2,$gid2,$rdev2,$size2,$atime2,$mtime2,$ctime2,$blksize2,$blocks2) = (0,0,0,0,0,0,0,0,0,0,0,0,0); + if(-e $filepath) + { + ($dev2,$ino2,$mode2,$nlink2,$uid2,$gid2,$rdev2,$size2,$atime2,$mtime2,$ctime2,$blksize2,$blocks2) = stat($filepath); + } + if( $mtime2 < $mtime ) + { + print "Regenarate SVG modified\n"; + my $pack = $filename; + SVG::SVG2zinc::parsefile( + $svgfile, + "PerlClass", + -out => "$autogenPath$filename$ftag.pm", + -verbose => 0, + -render => 1, + -namespace => 0, + -target => $tag + ); + } } + require "$filepath"; my $packagename = "$autogenPath$filename$ftag"; |