diff options
Diffstat (limited to 'src/MTools/SVG/SVGLoader.pm')
-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"; |