Author: sparky
Date: Tue Dec  5 04:04:29 2006
New Revision: 8067

Modified:
   vfmg/trunk/VFMG/Icons.pm
Log:
- fixed many things, it works !


Modified: vfmg/trunk/VFMG/Icons.pm
==============================================================================
--- vfmg/trunk/VFMG/Icons.pm    (original)
+++ vfmg/trunk/VFMG/Icons.pm    Tue Dec  5 04:04:29 2006
@@ -27,13 +27,13 @@
        return undef unless ($tmp);
        my $file = "$tmp/$sect";
 
-       umask 077;
+       umask 0077;
        unlink $file if -e $file;
        open F_OUT, ">", $file or warn "$file: $!\n" and return undef;
        push @del_files, $file;
        print F_OUT @{$main::rcSect{$sect}};
        close F_OUT or return undef;
-       chmod 700, $file;
+       chmod 0700, $file;
        return undef unless -x $file;
        return $file;
 }
@@ -50,11 +50,11 @@
                warn "Icons destination directory is not specified, not 
scaling.\n";
                return;
        }
-       if ( $main::opt{convert} =~ s/^\s*\$(\S+)\s+// ) {
+       if ( $main::opt{convert} =~ s/^\s*\$(\S+)// ) {
                my $sect = $1;
                my $conv = prepare_exec($sect);
                if ( defined $conv and length $conv ) {
-                       $main::opt{convert} =~ s/^/$conv /;
+                       $main::opt{convert} =~ s/^/$conv/;
                        $main::opt{icons} = 1;
                } else {
                        warn "Some error ocurred wile preparing '\$$sect' 
script\n";
@@ -71,12 +71,12 @@
        }
        return unless $main::opt{icons_scale};
 
-       return unless exists $main::opt{convert_post};
-       if ( $main::opt{convert_post} =~ s/^\s*\$(\S+)\s+// ) {
+       return unless defined $main::opt{convert_post};
+       if ( $main::opt{convert_post} =~ s/^\s*\$(\S+)// ) {
                my $sect = $1;
                my $post = prepare_exec($sect);
                if ( defined $post and length $post ) {
-                       $main::opt{convert_post} =~ s/^/$post /;
+                       $main::opt{convert_post} =~ s/^/$post/;
                } else {
                        warn "Some error ocurred wile preparing post '\$$sect' 
script\n";
                        delete $main::opt{convert_post};
@@ -160,18 +160,18 @@
 }
 
 sub finish {
-       return unless scalar @scale;
-
-       warn "Scaling $#scale icons\n";
-       my $fork = fork;
-       unless ( defined $fork ) {
-               warn "Fork failed, scaling in foreground\n";
-               $fork = 0;
-       }
-       return if $fork != 0;
-
-       foreach my $cmd (@scale) {
-               system($cmd);
+       if (scalar @scale) {
+               warn "Scaling $#scale icons\n";
+               my $fork = fork;
+               unless ( defined $fork ) {
+                       warn "Fork failed, scaling in foreground\n";
+                       $fork = 0;
+               }
+               exit if $fork != 0;
+               
+               foreach my $cmd (@scale) {
+                       system($cmd);
+               }
        }
        if ( exists $main::opt{convert_post} ) {
                system( $main::opt{convert_post} );
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to