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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Oct 22 09:57:23 CEST 2010


Revision: 11365
          http://gar.svn.sourceforge.net/gar/?rev=11365&view=rev
Author:   wahwah
Date:     2010-10-22 07:57:23 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
mGAR v2: checkpkg, added support for more soname cases, the new check can now process the whole catalog.

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

Modified: csw/mgar/gar/v2/lib/python/sharedlib_utils.py
===================================================================
--- csw/mgar/gar/v2/lib/python/sharedlib_utils.py	2010-10-21 16:03:50 UTC (rev 11364)
+++ csw/mgar/gar/v2/lib/python/sharedlib_utils.py	2010-10-22 07:57:23 UTC (rev 11365)
@@ -49,6 +49,14 @@
   return c.join(parts).lower()
 
 
+
+def SanitizeWithChar(s, c):
+  parts = LEGIT_CHAR_RE.findall(s)
+  if "so" in parts:
+    parts.remove("so")
+  return c.join(parts).lower()
+
+
 def MakePackageNameBySoname(soname):
   """Find the package name based on the soname.
 

Modified: csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py	2010-10-21 16:03:50 UTC (rev 11364)
+++ csw/mgar/gar/v2/lib/python/sharedlib_utils_test.py	2010-10-22 07:57:23 UTC (rev 11365)
@@ -146,7 +146,55 @@
     self.assertEqual(expected,
                      su.MakePackageNameBySoname(soname))
 
+  def testMakePackageNameBySonameMoreDot(self):
+    soname = "libgettextlib-0.14.1.so"
+    expected = (
+        ['CSWlibgettextlib-0-14-1'],
+        ['libgettextlib_0_14_1'],
+    )
+    self.assertEqual(expected,
+                     su.MakePackageNameBySoname(soname))
 
+  def testMakePackageNameBySonameComplexApr(self):
+    soname = "libapr-1.so.10.0.0"
+    expected = (
+       ['CSWlibapr-110', 'CSWlibapr-1-10'],
+       ['libapr_110', 'libapr_1_10']
+    )
+    self.assertEqual(expected,
+                     su.MakePackageNameBySoname(soname))
+
+  def testMakePackageNameBySonamePlus(self):
+    soname = "libstdc++.so.6"
+    expected = (
+       ['CSWlibstdc++6', 'CSWlibstdc++-6'],
+       ['libstdc++6', 'libstdc++_6']
+    )
+    self.assertEqual(expected,
+                     su.MakePackageNameBySoname(soname))
+
+  def testMakePackageNameBySonamePlus(self):
+    soname = "libdnet.1"
+    expected = (
+       ['CSWlibdnet1', 'CSWlibdnet-1'],
+       ['libdnet1', 'libdnet_1']
+    )
+    self.assertEqual(expected,
+                     su.MakePackageNameBySoname(soname))
+
+  def testMakePackageNameUppercase(self):
+    soname = "libUpperCase.so.1"
+    expected = (
+       ['CSWlibuppercase1', 'CSWlibuppercase-1'],
+       ['libuppercase1', 'libuppercase_1']
+    )
+    self.assertEqual(expected,
+                     su.MakePackageNameBySoname(soname))
+
+  def testSanitizeWithChar(self):
+    self.assertEqual("foo_0", su.SanitizeWithChar("foo-0", "_"))
+
+
 class MakePackageNameBySonameUnitTest(unittest.TestCase):
 
   def testSanitizeWithChar(self):


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