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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Jun 25 11:52:06 CEST 2011


Revision: 14885
          http://gar.svn.sourceforge.net/gar/?rev=14885&view=rev
Author:   wahwah
Date:     2011-06-25 09:52:06 +0000 (Sat, 25 Jun 2011)

Log Message:
-----------
pkgdb: Bugfix for pkgname->catalogname mapping

For the purpose of /var/sadm/install/contents file indexing, fake
package objects need to be created.  It was possible that two different
pkgnames were mapped to one catalogname, which caused a catalogname
conflict. This patch removes one problem, when the only difference
between two pkgnames is a number.

Patch by Igor Gali?\196?\135.

Signed-off-by: Maciej Blizi?\197?\132ski <maciej at opencsw.org>

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

Modified: csw/mgar/gar/v2/lib/python/opencsw.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw.py	2011-06-25 09:50:47 UTC (rev 14884)
+++ csw/mgar/gar/v2/lib/python/opencsw.py	2011-06-25 09:52:06 UTC (rev 14885)
@@ -484,7 +484,7 @@
   casechange = [False] + [x != y for x, y in neighbors]
   str_list = [(cc * "_") + l.lower() for l, cc in zip(s, casechange)]
   s2 = "".join(str_list)
-  return re.findall(r"[a-z]+", s2)
+  return re.findall(r"[a-z0-9]+", s2)
 
 
 def CatalogNameGroupName(catalogname_list):

Modified: csw/mgar/gar/v2/lib/python/opencsw_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw_test.py	2011-06-25 09:50:47 UTC (rev 14884)
+++ csw/mgar/gar/v2/lib/python/opencsw_test.py	2011-06-25 09:52:06 UTC (rev 14885)
@@ -399,6 +399,10 @@
     self.assertEquals("stuf_with_some_dashes",
                       opencsw.PkgnameToCatName("STUFwith-some-dashes"))
 
+  def testPkgnameToCatName5(self):
+    self.assertNotEquals(opencsw.PkgnameToCatName("SUNWi4rf"),
+                         opencsw.PkgnameToCatName("SUNWi7rf"))
+
   def test_4(self):
     pkginfo_dict = opencsw.ParsePkginfo(TEST_PKGINFO.splitlines())
     expected = "sunw_bash-11.10.0,REV=2005.01.08.01.09-SunOS5.10-i386-SUNW.pkg"


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