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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Oct 22 10:47:00 CEST 2010


Revision: 11377
          http://gar.svn.sourceforge.net/gar/?rev=11377&view=rev
Author:   wahwah
Date:     2010-10-22 08:46:59 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
Merge branch 'master' of file:///home/maciej/public_html/opencsw

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

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2010-10-22 08:01:18 UTC (rev 11376)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-10-22 08:46:59 UTC (rev 11377)
@@ -1102,7 +1102,6 @@
             % (binary_info["path"], policy_pkgname_list))
 
 
-
 def CheckSharedLibraryPkgDoesNotHaveTheSoFile(pkg_data, error_mgr, logger, messenger):
   """If it's a package with shared libraries, it should not contain the .so file.
 
@@ -1137,16 +1136,31 @@
               "the .so file together with the header files in the devel "
               "package." % entry["path"])
 
-
 def CheckPackagesWithHeaderFilesMustContainTheSoFile(pkg_data, error_mgr, logger, messenger):
-  """Generated two kinds of messages:
+  pkgname = pkg_data["basic_stats"]["pkgname"]
+  shared_libs = set(su.GetSharedLibs(pkg_data))
+  shared_libs = filter(su.IsLibraryLinkable, shared_libs)
+  if shared_libs:
+    # If the package contains shared libraries, it must not contain
+    # corrersponding .so files, which are used during linking.
+    for entry in pkg_data["pkgmap"]:
+      if entry["path"]:
+        if entry["path"].endswith(".so") and entry["type"] == "s":
+          error_mgr.ReportError(
+              "shared-lib-package-contains-so-symlink",
+              "file=%s" % entry["path"])
+          messenger.Message(
+              "The package contains shared libraries together with the "
+              "symlink of the form libfoo.so -> libfoo.so.1.  "
+              "In this case: %s.  "
+              "This kind of symlink should not be together with the shared "
+              "libraries; it is only used during compiling and linking.  "
+              "The best practice "
+              "is to put the shared libraries into a separate package, and "
+              "the .so file together with the header files in the devel "
+              "package." % entry["path"])
 
-    1. Contains .h but not .so
-    2. Contains .so but not .h
-  """
-  pass
 
-
 def CheckSharedLibraryNameMustBeAsubstringOfSoname(
     pkg_data, error_mgr, logger, messenger):
   pkgname = pkg_data["basic_stats"]["pkgname"]


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