Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs1:/tmp/cvs-serv17153/perlmod/Fink

Modified Files:
        ChangeLog Engine.pm Services.pm 
Log Message:
Fixing problems with exit codes (Patch #662894).

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -r1.243 -r1.244
--- ChangeLog   14 Jan 2003 20:32:10 -0000      1.243
+++ ChangeLog   14 Jan 2003 21:46:14 -0000      1.244
@@ -1,5 +1,7 @@
 2003-01-14  Max Horn  <[EMAIL PROTECTED]>
 
+       * Engine.pm, Services.pm: Fixing problems with exit codes (Patch #662894).
+
        * Engine.pm: 'fink apropos' command now also matches the package name,
          not just the package description (Patch #661169).
 

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- Engine.pm   14 Jan 2003 20:32:30 -0000      1.84
+++ Engine.pm   14 Jan 2003 21:46:15 -0000      1.85
@@ -164,7 +164,10 @@
   eval { &$proc(@_); };
   if ($@) {
     print "Failed: $@";
+    return $? || 1;
   }
+
+  return 0;
 }
 
 ### restart as root with command

Index: Services.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Services.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Services.pm 14 Jan 2003 20:28:24 -0000      1.33
+++ Services.pm 14 Jan 2003 21:46:15 -0000      1.34
@@ -206,17 +206,17 @@
 sub execute {
   my $cmd = shift;
   my $quiet = shift || 0;
-  my ($retval, $commandname);
+  my ($commandname);
 
   return if ($cmd =~ /^\s*$/); # Ignore empty commands
   print "$cmd\n";
-  $retval = system($cmd);
-  $retval >>= 8 if defined $retval and $retval >= 256;
-  if ($retval and not $quiet) {
+  system($cmd);
+  $? >>= 8 if defined $? and $? >= 256;
+  if ($? and not $quiet) {
     ($commandname) = split(/\s+/, $cmd);
-    print "### execution of $commandname failed, exit code $retval\n";
+    print "### execution of $commandname failed, exit code $?\n";
   }
-  return $retval;
+  return $?;
 }
 
 ### execute a full script



-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to