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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Dec 27 13:24:11 CET 2010


Revision: 12091
          http://gar.svn.sourceforge.net/gar/?rev=12091&view=rev
Author:   wahwah
Date:     2010-12-27 12:24:11 +0000 (Mon, 27 Dec 2010)

Log Message:
-----------
checkpkg: Moving 'dump' calls to InspectivePackage

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

Modified: csw/mgar/gar/v2/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package.py	2010-12-27 12:23:45 UTC (rev 12090)
+++ csw/mgar/gar/v2/lib/python/inspective_package.py	2010-12-27 12:24:11 UTC (rev 12091)
@@ -114,7 +114,26 @@
         self.file_paths.extend([f.replace(remove_prefix, "") for f in full_paths])
     return self.file_paths
 
+  def GetBinaryDumpInfo(self):
+    # Binaries. This could be split off to a separate function.
+    # man ld.so.1 for more info on this hack
+    env = copy.copy(os.environ)
+    env["LD_NOAUXFLTR"] = "1"
+    binaries_dump_info = []
+    for binary in self.ListBinaries():
+      binary_abs_path = os.path.join(self.directory, "root", binary)
+      binary_base_name = os.path.basename(binary)
+      args = [common_constants.DUMP_BIN, "-Lv", binary_abs_path]
+      dump_proc = subprocess.Popen(args, stdout=subprocess.PIPE, env=env)
+      stdout, stderr = dump_proc.communicate()
+      ret = dump_proc.wait()
+      binary_data = ldd_emul.ParseDumpOutput(stdout)
+      binary_data["path"] = binary
+      binary_data["base_name"] = binary_base_name
+      binaries_dump_info.append(binary_data)
+    return binaries_dump_info
 
+
 class FileMagic(object):
   """Libmagic sometimes returns None, which I think is a bug.
   Trying to come up with a way to work around that.  It might not even be

Modified: csw/mgar/gar/v2/lib/python/package_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats.py	2010-12-27 12:23:45 UTC (rev 12090)
+++ csw/mgar/gar/v2/lib/python/package_stats.py	2010-12-27 12:24:11 UTC (rev 12091)
@@ -128,23 +128,7 @@
 
   def GetBinaryDumpInfo(self):
     dir_pkg = self.GetInspectivePkg()
-    # Binaries. This could be split off to a separate function.
-    # man ld.so.1 for more info on this hack
-    env = copy.copy(os.environ)
-    env["LD_NOAUXFLTR"] = "1"
-    binaries_dump_info = []
-    for binary in dir_pkg.ListBinaries():
-      binary_abs_path = os.path.join(dir_pkg.directory, "root", binary)
-      binary_base_name = os.path.basename(binary)
-      args = [common_constants.DUMP_BIN, "-Lv", binary_abs_path]
-      dump_proc = subprocess.Popen(args, stdout=subprocess.PIPE, env=env)
-      stdout, stderr = dump_proc.communicate()
-      ret = dump_proc.wait()
-      binary_data = ldd_emul.ParseDumpOutput(stdout)
-      binary_data["path"] = binary
-      binary_data["base_name"] = binary_base_name
-      binaries_dump_info.append(binary_data)
-    return binaries_dump_info
+    return dir_pkg.GetBinaryDumpInfo()
 
   def GetBasicStats(self):
     dir_pkg = self.GetInspectivePkg()


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