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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Jan 21 17:14:42 CET 2011


Revision: 13044
          http://gar.svn.sourceforge.net/gar/?rev=13044&view=rev
Author:   wahwah
Date:     2011-01-21 16:14:42 +0000 (Fri, 21 Jan 2011)

Log Message:
-----------
checkpkg: Devel package suggestions fix for GAR

checkpkg was suggesting a catalogname with the CSW prefix.  This patch fixes
it.

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

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2011-01-21 16:12:33 UTC (rev 13043)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2011-01-21 16:14:42 UTC (rev 13044)
@@ -1093,7 +1093,8 @@
           messenger.SuggestGarLine(
               "PKGFILES_%s-dev += %s" % (pkgname, entry["path"]))
           messenger.SuggestGarLine(
-              "CATALOGNAME_%s-dev = %s_dev" % (pkgname, pkgname.replace("-", "_")))
+              "CATALOGNAME_%s-dev = %s_dev"
+              % (pkgname, pkg_data["basic_stats"]["catalogname"]))
           messenger.Message(
               "The package contains shared libraries together with the "
               "symlink of the form libfoo.so -> libfoo.so.1.  "

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-01-21 16:12:33 UTC (rev 13043)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-01-21 16:14:42 UTC (rev 13044)
@@ -1415,16 +1415,50 @@
     self.pkg_data = bdb48_stats[0]
 
 
-class TestCheckSharedLibraryPkgDoesNotHaveTheSoFile(CheckpkgUnitTestHelper, unittest.TestCase):
+class TestCheckSharedLibraryPkgDoesNotHaveTheSoFile(CheckpkgUnitTestHelper,
+                                                    unittest.TestCase):
   FUNCTION_NAME = 'CheckSharedLibraryPkgDoesNotHaveTheSoFile'
+
   def CheckpkgTest(self):
     self.pkg_data = neon_stats[0]
     self.error_mgr_mock.ReportError(
-        'shared-lib-package-contains-so-symlink', 'file=/opt/csw/lib/libneon.so')
+        'shared-lib-package-contains-so-symlink',
+        'file=/opt/csw/lib/libneon.so')
     self.error_mgr_mock.ReportError(
-        'shared-lib-package-contains-so-symlink', 'file=/opt/csw/lib/sparcv9/libneon.so')
+        'shared-lib-package-contains-so-symlink',
+        'file=/opt/csw/lib/sparcv9/libneon.so')
 
 
+class TestCheckSharedLibraryPkgDoesNotHaveTheSoFileSuggestion(
+    CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckSharedLibraryPkgDoesNotHaveTheSoFile'
+
+  def SetMessenger(self):
+    """Overriding this method to use mock instead of a stub."""
+    self.messenger = self.mox.CreateMock(stubs.MessengerStub)
+
+  def CheckpkgTest(self):
+    self.pkg_data = neon_stats[0]
+    self.error_mgr_mock.ReportError(
+        'shared-lib-package-contains-so-symlink',
+        'file=/opt/csw/lib/libneon.so')
+    self.error_mgr_mock.ReportError(
+        'shared-lib-package-contains-so-symlink',
+        'file=/opt/csw/lib/sparcv9/libneon.so')
+    self.messenger.SuggestGarLine("# (If CSWneon-dev doesn't exist yet)")
+    self.messenger.SuggestGarLine('PACKAGES += CSWneon-dev')
+    self.messenger.SuggestGarLine(
+        'PKGFILES_CSWneon-dev += /opt/csw/lib/libneon.so')
+    self.messenger.SuggestGarLine('CATALOGNAME_CSWneon-dev = neon_dev')
+    self.messenger.Message(mox.IsA(str))
+    self.messenger.SuggestGarLine("# (If CSWneon-dev doesn't exist yet)")
+    self.messenger.SuggestGarLine('PACKAGES += CSWneon-dev')
+    self.messenger.SuggestGarLine(
+        'PKGFILES_CSWneon-dev += /opt/csw/lib/sparcv9/libneon.so')
+    self.messenger.SuggestGarLine('CATALOGNAME_CSWneon-dev = neon_dev')
+    self.messenger.Message(mox.IsA(str))
+
+
 class TestCheckSharedLibraryNameMustBeAsubstringOfSonameGood(
     CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckSharedLibraryNameMustBeAsubstringOfSoname'


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