[csw-devel] SF.net SVN: gar:[20106] csw/mgar/gar/v2/lib/python/inspective_package.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sun Jan 13 12:37:25 CET 2013


Revision: 20106
          http://gar.svn.sourceforge.net/gar/?rev=20106&view=rev
Author:   wahwah
Date:     2013-01-13 11:37:25 +0000 (Sun, 13 Jan 2013)
Log Message:
-----------
checkpkg: When parsing ldd output fails, log it

It's useful to have the complete output from ldd logged. More so, if you're
running in screen with a long scrollback buffer which gives you an option to
save that output into a file on disk.

We could potentially save the ldd output to disk instead of printing to
screen. Suggestions are welcome.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/inspective_package.py

Modified: csw/mgar/gar/v2/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package.py	2013-01-13 11:36:40 UTC (rev 20105)
+++ csw/mgar/gar/v2/lib/python/inspective_package.py	2013-01-13 11:37:25 UTC (rev 20106)
@@ -1,6 +1,7 @@
 import package
 import os
 import re
+import sys
 import logging
 import hachoir_parser
 import sharedlib_utils
@@ -312,7 +313,11 @@
 
         stderr = re.sub(ignored_error_re, "", stderr)
         if stderr:
-          msg = "%s returned one or more errors: %s" % (args, stderr)
+          msg = ("%s returned one or more errors: %s" % (args, stderr) +
+                 "\n\n" +
+                 "ERROR: ldd invocation failed. Please copy this message " +
+                 "and the above messages into your report and send " +
+                 "as path of the error report.")
           raise package.Error(msg)
       elfdump_out = stdout.splitlines()
 
@@ -323,7 +328,12 @@
       cur_section = None
       for line in elfdump_out:
 
-        elf_info, cur_section = self._ParseElfdumpLine(line, cur_section)
+        try:
+          elf_info, cur_section = self._ParseElfdumpLine(line, cur_section)
+        except package.StdoutSyntaxError as e:
+          sys.stderr.write("elfdump out:\n")
+          sys.stderr.write(stdout)
+          raise
 
         # header or blank line contains no information
         if not elf_info:

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list