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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Aug 3 11:06:51 CEST 2011


Revision: 15249
          http://gar.svn.sourceforge.net/gar/?rev=15249&view=rev
Author:   wahwah
Date:     2011-08-03 09:06:51 +0000 (Wed, 03 Aug 2011)

Log Message:
-----------
checkpkg: Shared libraries need the .so extension

Based on the libdnet example and bug 4811.

http://lists.opencsw.org/pipermail/maintainers/2011-August/015089.html
https://www.opencsw.org/mantis/view.php?id=4811

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-08-03 09:05:46 UTC (rev 15248)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2011-08-03 09:06:51 UTC (rev 15249)
@@ -1307,3 +1307,12 @@
     error_mgr.NeedFile(
         "/opt/csw/sbin/alternatives",
         "The alternatives subsystem is used")
+
+
+def CheckSharedLibrarySoExtension(pkg_data, error_mgr, logger, messenger):
+  shared_libs = set(su.GetSharedLibs(pkg_data))
+  for shared_lib in shared_libs:
+    if ".so" not in shared_lib:
+      error_mgr.ReportError(
+          "shared-library-missing-dot-so",
+          "file=%s" % shared_lib)

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-08-03 09:05:46 UTC (rev 15248)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-08-03 09:06:51 UTC (rev 15249)
@@ -1819,5 +1819,21 @@
         "The alternatives subsystem is used")
 
 
+class TestCheckSharedLibrarySoExtension(
+    CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckSharedLibrarySoExtension'
+  def CheckpkgTest(self):
+    self.pkg_data = copy.deepcopy(neon_stats[0])
+
+  def CheckpkgTest2(self):
+    self.pkg_data = copy.deepcopy(neon_stats[0])
+    self.pkg_data["files_metadata"][11]["path"] = "foo.1"
+    self.error_mgr_mock.ReportError(
+        'shared-library-missing-dot-so', 'file=foo.1')
+
+  def testTwo(self):
+    self.RunCheckpkgTest(self.CheckpkgTest2)
+
+
 if __name__ == '__main__':
   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