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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sun Feb 5 01:58:09 CET 2012


Revision: 16994
          http://gar.svn.sourceforge.net/gar/?rev=16994&view=rev
Author:   wahwah
Date:     2012-02-05 00:58:08 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
checkpkg: Add a safeguard against a broken link

If there's an "s" or an "l" pkgmap entry without the "=" sign, indexing of the
package would break.  Adding a safeguard against it.

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

Modified: csw/mgar/gar/v2/lib/python/pkgmap.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgmap.py	2012-02-05 00:53:40 UTC (rev 16993)
+++ csw/mgar/gar/v2/lib/python/pkgmap.py	2012-02-05 00:58:08 UTC (rev 16994)
@@ -86,11 +86,15 @@
       prototype_class = fields[2]
     elif line_type in ('s', 'l'):
       # soft- and hardlinks
-      link_from, link_to = fields[3].split("=")
-      installed_path = link_from
-      line_to_add = "%s --> %s" % (link_from, link_to)
-      target = struct_util.ResolveSymlink(link_from, link_to)
-      prototype_class = fields[2]
+      # This breaks if PAX is broken. A rare case, but can happen.
+      if "=" not in fields[3]:
+        line_to_add = "broken link entry: %s" % fields[3]
+      else:
+        link_from, link_to = fields[3].split("=")
+        installed_path = link_from
+        line_to_add = "%s --> %s" % (link_from, link_to)
+        target = struct_util.ResolveSymlink(link_from, link_to)
+        prototype_class = fields[2]
     if line_to_add:
       self.paths.add(line_to_add)
     entry = {

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