Explorar o código

Better dpkg error reporting
Author: jgg
Date: 1999-03-05 19:36:49 GMT
Better dpkg error reporting

Arch Librarian %!s(int64=22) %!d(string=hai) anos
pai
achega
f956efb4ab
Modificáronse 2 ficheiros con 10 adicións e 4 borrados
  1. 8 2
      apt-pkg/deb/dpkgpm.cc
  2. 2 2
      apt-pkg/sourcelist.cc

+ 8 - 2
apt-pkg/deb/dpkgpm.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: dpkgpm.cc,v 1.7 1999/01/31 08:55:53 jgg Exp $
+// $Id: dpkgpm.cc,v 1.8 1999/03/05 19:36:49 jgg Exp $
 /* ######################################################################
 
    DPKG Package Manager - Provide an interface to dpkg
@@ -310,7 +310,13 @@ bool pkgDPkgPM::Go()
       if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
       {
 	 RunScripts("DPkg::Post-Invoke");
-	 return _error->Error("Sub-process returned an error code");
+	 if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV)
+	    return _error->Error("Sub-process recieved a segmentation fault.");
+	    
+	 if (WIFEXITED(Status) != 0)
+	    return _error->Error("Sub-process returned an error code (%u)",WEXITSTATUS(Status));
+	 
+	 return _error->Error("Sub-process exited unexpectedly");
       }      
    }
 

+ 2 - 2
apt-pkg/sourcelist.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: sourcelist.cc,v 1.11 1999/03/02 18:35:24 jgg Exp $
+// $Id: sourcelist.cc,v 1.12 1999/03/05 19:36:49 jgg Exp $
 /* ######################################################################
 
    List of Sources
@@ -135,7 +135,7 @@ bool pkgSourceList::Item::SetType(string S)
       return true;
    }
 
-   return true;
+   return false;
 }
 									/*}}}*/
 // SourceList::Item::SetURI - Set the URI				/*{{{*/