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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Dec 17 10:41:33 CET 2010


Revision: 11979
          http://gar.svn.sourceforge.net/gar/?rev=11979&view=rev
Author:   wahwah
Date:     2010-12-17 09:41:32 +0000 (Fri, 17 Dec 2010)

Log Message:
-----------
checkpkg: Strip exclamation marks from pkgnames

When a package installation fails, it's marked !CSWfoo in
/var/sadm/install/contents.  The exclamation mark has to be stripped before
querying the database with the pkgname.

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

Modified: csw/mgar/gar/v2/lib/python/system_pkgmap.py
===================================================================
--- csw/mgar/gar/v2/lib/python/system_pkgmap.py	2010-12-17 09:00:49 UTC (rev 11978)
+++ csw/mgar/gar/v2/lib/python/system_pkgmap.py	2010-12-17 09:41:32 UTC (rev 11979)
@@ -496,7 +496,7 @@
     # SUNWjhrt:j3link
     pkgname_orig = pkgname
     pkgname = pkgname.split(":")[0]
-    pkgname = pkgname.lstrip("*")
-    pkgname = pkgname.lstrip("~")
+    for c in ('*', '~', '!'):
+      pkgname = pkgname.lstrip(c)
     # logging.debug("d['pkgnames']: %s → %s", pkgname_orig, pkgname)
     return pkgname

Modified: csw/mgar/gar/v2/lib/python/system_pkgmap_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/system_pkgmap_test.py	2010-12-17 09:00:49 UTC (rev 11978)
+++ csw/mgar/gar/v2/lib/python/system_pkgmap_test.py	2010-12-17 09:41:32 UTC (rev 11979)
@@ -288,7 +288,13 @@
         "SUNWjai",
         importer.SanitizeInstallContentsPkgname("SUNWjai:j5link"))
 
+  def testSanitizeInstallContentsPkgnameInstallError(self):
+    importer = system_pkgmap.InstallContentsImporter()
+    self.assertEquals(
+        "CSWmozilla",
+        importer.SanitizeInstallContentsPkgname("!CSWmozilla"))
 
+
 if __name__ == '__main__':
   logging.basicConfig(level=logging.CRITICAL)
   unittest.main()


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