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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Mar 27 03:29:30 CET 2010


Revision: 9396
          http://gar.svn.sourceforge.net/gar/?rev=9396&view=rev
Author:   wahwah
Date:     2010-03-27 02:29:30 +0000 (Sat, 27 Mar 2010)

Log Message:
-----------
mGAR v2: checkpkg, better RPATH handling, added unit tests.

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

Added Paths:
-----------
    csw/mgar/gar/v2/lib/python/testdata/rpaths.py
    csw/mgar/gar/v2/lib/python/testdata/stats/46/461a24f02dd5020b4aa014b76f3ec2cc/ldd_dash_r.yml

Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py	2010-03-26 23:52:15 UTC (rev 9395)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -938,7 +938,7 @@
       # "defined_symbols",
       "depends",
       "isalist",
-      "ldd_dash_r",
+      # "ldd_dash_r",
       "overrides",
       "pkgchk",
       "pkginfo",
@@ -1179,8 +1179,8 @@
     self.DumpObject(self.GetPkgchkData(), "pkgchk")
     self.DumpObject(dir_pkg.GetParsedPkginfo(), "pkginfo")
     self.DumpObject(dir_pkg.GetPkgmap().entries, "pkgmap")
-    # To be used with Perl modules
-    self.DumpObject(self.GetLddMinusRlines(), "ldd_dash_r")
+    # The ldd -r reporting breaks on bigger packages during yaml saving.
+    # self.DumpObject(self.GetLddMinusRlines(), "ldd_dash_r")
     # This check is currently disabled, let's save time by not collecting
     # these data.
     # self.DumpObject(self.GetDefinedSymbols(), "defined_symbols")
@@ -1243,7 +1243,12 @@
     symbol_not_found_re = r"^\tsymbol not found:\s(?P<symbol>\S+)\s+\((?P<path_not_found>\S+)\)"
     only_so = r"^\t(?P<path_only>\S+)$"
     version_so = r'^\t(?P<soname_version_not_found>\S+) \((?P<lib_name>\S+)\) =>\t \(version not found\)'
-    common_re = r"(%s|%s|%s|%s)" % (found_re, symbol_not_found_re, only_so, version_so)
+    stv_protected = (r'^\trelocation \S+ symbol: (?P<relocation_symbol>\S+): '
+                     r'file (?P<relocation_path>\S+): '
+                     r'relocation bound to a symbol with STV_PROTECTED visibility$')
+    common_re = (r"(%s|%s|%s|%s|%s)"
+                 % (found_re, symbol_not_found_re, only_so, version_so,
+                    stv_protected))
     m = re.match(common_re, line)
     response = {}
     if m:
@@ -1269,10 +1274,17 @@
         response["soname"] = d["soname_version_not_found"]
         response["path"] = None
         response["symbol"] = None
+      elif d["relocation_symbol"]:
+        response["state"] = 'relocation-bound-to-a-symbol-with-STV_PROTECTED-visibility'
+        response["soname"] = None
+        response["path"] = d["relocation_path"]
+        response["symbol"] = d["relocation_symbol"]
       else:
-        raise StdoutSyntaxError("Could not parse %s" % repr(line))
+        raise StdoutSyntaxError("Could not parse %s with %s"
+                                % (repr(line), common_re))
     else:
-      raise StdoutSyntaxError("Could not parse %s" % repr(line))
+      raise StdoutSyntaxError("Could not parse %s with %s"
+                              % (repr(line), common_re))
     return response
 
 

Modified: csw/mgar/gar/v2/lib/python/checkpkg_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg_test.py	2010-03-26 23:52:15 UTC (rev 9395)
+++ csw/mgar/gar/v2/lib/python/checkpkg_test.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -379,6 +379,18 @@
     }
     self.assertEqual(expected, self.pkgstats._ParseLddDashRline(line))
 
+  def test_ParseLdd_StvProtectedVisibility(self):
+    line = ('\trelocation R_SPARC_COPY symbol: ASN1_OCTET_STRING_it: '
+            'file /opt/csw/lib/sparcv8plus+vis/libcrypto.so.0.9.8: '
+            'relocation bound to a symbol with STV_PROTECTED visibility')
+    expected = {
+        'symbol': 'ASN1_OCTET_STRING_it',
+        'soname': None,
+        'path': '/opt/csw/lib/sparcv8plus+vis/libcrypto.so.0.9.8',
+        'state': 'relocation-bound-to-a-symbol-with-STV_PROTECTED-visibility',
+    }
+    self.assertEqual(expected, self.pkgstats._ParseLddDashRline(line))
+
   def test_ParseLddDashRlineManyLines(self):
     for line in LDD_R_OUTPUT_1.splitlines():
       parsed = self.pkgstats._ParseLddDashRline(line)

Modified: csw/mgar/gar/v2/lib/python/dependency_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks.py	2010-03-26 23:52:15 UTC (rev 9395)
+++ csw/mgar/gar/v2/lib/python/dependency_checks.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -3,6 +3,14 @@
 import checkpkg
 import re
 
+DEPRECATED_LIBRARY_LOCATIONS = (
+    ("/opt/csw/lib", "libdb-4.7.so", "Deprecated Berkeley DB location"),
+    ("/opt/csw/lib/mysql", "libmysqlclient_r.so.15",
+     "Please use /opt/csw/mysql5/..."),
+    ("/opt/csw/lib/mysql", "libmysqlclient.so.15",
+     "Please use /opt/csw/mysql5/..."),
+)
+
 def Libraries(pkg_data, error_mgr, logger, path_and_pkg_by_soname):
   pkgname = pkg_data["basic_stats"]["pkgname"]
   logger.debug("Package %s", pkgname)
@@ -25,15 +33,8 @@
               resolved_path, path_and_pkg_by_soname[soname][resolved_path])
           resolved = True
           req_pkg = path_and_pkg_by_soname[soname][resolved_path][-1]
-          # TODO: Throw an error when /opt/csw/lib/libdb-4.7.so gets resolved
           reason = "provides %s/%s needed by %s" % (resolved_path, soname, binary_info["path"])
-          BAD_COMBINATIONS = (
-              ("/opt/csw/lib", "libdb-4.7.so", "Deprecated Berkeley DB location"),
-          )
-          logger.debug("Checking deprecated library locations.")
-          for bad_path, bad_soname, msg in BAD_COMBINATIONS:
-            # print "resolved_path == bad_path", resolved_path, bad_path, resolved_path == bad_path
-            # print "soname == bad_soname", soname, bad_soname, soname == bad_soname
+          for bad_path, bad_soname, msg in DEPRECATED_LIBRARY_LOCATIONS:
             if resolved_path == bad_path and soname == bad_soname:
               logger.debug("Bad lib found: %s/%s", bad_path, bad_soname)
               error_mgr.ReportError(

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2010-03-26 23:52:15 UTC (rev 9395)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -49,13 +49,28 @@
 ARCH_LIST = ["sparc", "i386", "all"]
 VERSION_RE = r".*,REV=(20[01][0-9]\.[0-9][0-9]\.[0-9][0-9]).*"
 DO_NOT_LINK_AGAINST_THESE_SONAMES = set(["libX11.so.4"])
-DISCOURAGED_FILE_PATTERNS = (r"\.py[co]$",)
-BAD_RPATH_LIST = [
-    r'/opt/csw/lib/mysql/lib',
-    r'/opt/csw/lib/mysql/lib/sparcv9',
-    r'/opt/csw/lib/\$ISALIST',
-    r'/opt/csw/lib/$$ISALIST',
-    r'/opt/csw/lib/SALIST',
+DISCOURAGED_FILE_PATTERNS = (
+    r"\.py[co]$",
+    r"/lib\w+\.l?a$",
+)
+RPATH_PARTS = {
+    'prefix': r"(?P<prefix>/opt/csw)",
+    'prefix_extra': r"(?P<prefix_extra>(/(?!lib)[\w-]+)*)",
+    'subdirs': r"(?P<subdirs>(/(?!-R)[\w\-\.]+)*)",
+    'isalist': r"(?P<isalist>/(\$ISALIST|64))",
+    'subdir2': r"(?P<subdir2>/[\w\-\.]+)",
+}
+RPATH_WHITELIST = [
+    ("^"
+     "%(prefix)s"
+     "%(prefix_extra)s"
+     "/(lib|libexec)"
+     "%(subdirs)s"
+     "%(isalist)s?"
+     "%(subdir2)s?"
+     "$") % RPATH_PARTS,
+    r"^\$ORIGIN$",
+    r"^/usr(/(ccs|dt|openwin))?/lib(/sparcv9)?$",
 ]
 # Check ldd -r only for Perl modules
 SYMBOLS_CHECK_ONLY_FOR = r"^CSWpm.*$"
@@ -490,9 +505,10 @@
     if pkgname != pkg_data["basic_stats"]["pkgname"]:
       disallowed_paths = set(paths_only_allowed_in[pkgname])
       intersection = disallowed_paths.intersection(paths_in_pkg)
-      logger.debug("Bad paths found: %s", intersection)
-      for bad_path in intersection:
-        error_mgr.ReportError("disallowed-path", bad_path)
+      if intersection:
+        logger.debug("Bad paths found: %s", intersection)
+        for bad_path in intersection:
+          error_mgr.ReportError("disallowed-path", bad_path)
 
 
 def CheckLinkingAgainstSunX11(pkg_data, error_mgr, logger):
@@ -528,15 +544,29 @@
       logger.warn(line)
 
 def CheckRpath(pkg_data, error_mgr, logger):
-  # for bad_rpath in BAD_RPATH_LIST:
-  bad_rpath_set = set(BAD_RPATH_LIST)
+  regex_whitelist = [re.compile(x) for x in RPATH_WHITELIST]
   for binary_info in pkg_data["binaries_dump_info"]:
-    for actual_rpath in binary_info["runpath"]:
-      if actual_rpath in bad_rpath_set:
-        error_mgr.ReportError("bad-rpath-entry",
-                              "%s %s" % (binary_info["path"], actual_rpath))
+    actual_rpaths = binary_info["runpath"]
+    matching = []
+    not_matching = []
+    for rpath in actual_rpaths:
+      matched = False
+      for white_re in regex_whitelist:
+        m = white_re.match(rpath)
+        if m:
+          matching.append((rpath, m.groupdict()))
+          matched = True
+          break
+      if matched:
+        matching.append(rpath)
+      else:
+        not_matching.append(rpath)
 
+    for bad in sorted(not_matching):
+      logger.debug("Bad rpath: %s", bad)
+      error_mgr.ReportError("bad-rpath-entry", bad)
 
+
 def DisabledCheckForMissingSymbols(pkgs_data, debug):
   """Analyzes missing symbols reported by ldd -r.
 
@@ -575,21 +605,28 @@
   return errors
 
 
-def CheckForMissingSymbolsDumb(pkg_data, error_mgr, logger):
+def DisableCheckForMissingSymbolsDumb(pkg_data, error_mgr, logger):
   """Analyzes missing symbols reported by ldd -r.
 
-  Only makes sense for perl modules.
+  So far only made sense for perl modules.  Disables because it falls over on
+  big KDE packages.
   """
   pkgname = pkg_data["basic_stats"]["pkgname"]
   if not re.match(SYMBOLS_CHECK_ONLY_FOR, pkgname):
     return
-  found = False
+  symbol_not_found_was_seen = False
+  relocation_was_seen = False
   for binary_info in pkg_data["binaries_dump_info"]:
     for ldd_elem in pkg_data["ldd_dash_r"][binary_info["path"]]:
-      if ldd_elem["state"] == "symbol-not-found":
+      if not symbol_not_found_was_seen and ldd_elem["state"] == "symbol-not-found":
         error_mgr.ReportError("symbol-not-found",
                               "e.g. %s misses %s" % (binary_info["path"], ldd_elem["symbol"]))
-        found = True
-        break
-    if found:
-      break
+        symbol_not_found_was_seen = True
+      if (not relocation_was_seen
+            and
+          ldd_elem["state"] == 'relocation-bound-to-a-symbol-with-STV_PROTECTED-visibility'):
+        error_mgr.ReportError(ldd_elem["state"],
+            "e.g. symbol: %s file: %s "
+            "relocation bound to a symbol with STV_PROTECTED visibility"
+            % (ldd_elem["symbol"], ldd_elem["path"]))
+

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-03-26 23:52:15 UTC (rev 9395)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -14,6 +14,7 @@
 
 import testdata.checkpkg_test_data_CSWdjvulibrert as td_1
 import testdata.checkpkg_pkgs_data_minimal as td_2
+import testdata.rpaths
 
 BASE_DIR = os.path.dirname(__file__)
 TESTDATA_DIR = os.path.join(BASE_DIR, "testdata")
@@ -302,5 +303,119 @@
         "It should be 'username at hostname-timestamp', but it's 'build8s20090904191054'.")
 
 
+class TestCheckRpath(CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckRpath'
+  def CheckpkgTest(self):
+    binaries_dump_info = self.pkg_data["binaries_dump_info"]
+    binaries_dump_info[0]["runpath"] = testdata.rpaths.all_rpaths
+    self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '$ORIGIN/..')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '$ORIGIN/../../../usr/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '$ORIGIN/../../usr/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '$ORIGIN/../lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '$ORIGIN/../ure-link/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '../../../../../dist/bin')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '../../../../dist/bin')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '../../../dist/bin')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '../../dist/bin')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/bin')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/home/buysse/build/expect-5.42.1/cswstage/opt/csw/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/home/phil/build/gettext-0.14.1/gettext-tools/intl/.libs')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/medusa/kenmays/build/qt-x11-free-3.3.3/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/medusa/kenmays/build/s_qt/qt-x11-free-3.3.3/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/plugins/designer')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/plugins/sqldrivers')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/home/harpchad/local/sparc/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/lib/sparcv9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWcluster/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWmlib/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/stlport4')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/v8plus')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/v8plusa')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/v8plusb')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/SUNWspro/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/build/michael/synce-0.8.9-buildroot/opt/csw/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/$ISALIST')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw//lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/X11/lib/')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/bdb4/lib/')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/$')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/$$ISALIST')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/-R/opt/csw/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/\\$ISALIST')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/\\SALIST')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/lib/sparcv8plus+vis')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/mysql4//lib/mysql')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/nagios/lib/\\$ISALIST')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/openoffice.org/basis3.1/program')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/csw/openoffice.org/ure/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/cw/gcc3/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/forte8/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/forte8/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/forte8/SUNWspro/lib/rw7/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/forte8/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/forte8/SUNWspro/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/schily/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/sfw/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS10/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS10/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS10/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS10/SUNWspro/lib/v8plus')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/rw7/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/stlport4')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/stlport4/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/v8plus')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS11/SUNWspro/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib/rw7/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib/v8plusa')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio/SOS8/SUNWspro/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/rw7')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/rw7/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/stlport4')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/stlport4/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/v8')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/opt/studio10/SUNWspro/lib/v9')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/oracle/product/9.2.0/lib32')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/X/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/local/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/local/openldap-2.3/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/sfw/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/ucblib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', '/usr/xpg4/lib')
+    self.error_mgr_mock.ReportError('bad-rpath-entry', 'RIGIN/../lib')
+
+
+class TestCheckRpathBadPath(CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'SetCheckLibraries'
+  def CheckpkgTest(self):
+    binaries_dump_info = self.pkg_data["binaries_dump_info"]
+    binaries_dump_info[0]["runpath"] = ["/opt/csw/lib"]
+    binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
+    self.pkg_data["depends"] = (("CSWfoo", None),)
+    self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+    self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
+       u'/opt/csw/lib': [u'CSWfoo'],
+       u'/opt/csw/lib/sparcv9': [u'CSWfoo'],
+    })
+    self.error_mgr_mock.ReportError(
+        'deprecated-library',
+        u'opt/csw/bin/sparcv9/rsync Deprecated Berkeley DB location '
+        u'/opt/csw/lib/libdb-4.7.so')
+    self.pkg_data = [self.pkg_data]
+
+
 if __name__ == '__main__':
   unittest.main()

Added: csw/mgar/gar/v2/lib/python/testdata/rpaths.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/rpaths.py	                        (rev 0)
+++ csw/mgar/gar/v2/lib/python/testdata/rpaths.py	2010-03-27 02:29:30 UTC (rev 9396)
@@ -0,0 +1,187 @@
+all_rpaths = set([
+     '$ORIGIN',
+     '$ORIGIN/..',
+     '$ORIGIN/../../../usr/lib/v9',
+     '$ORIGIN/../../usr/lib',
+     '$ORIGIN/../lib',
+     '$ORIGIN/../ure-link/lib',
+     '../../../../../dist/bin',
+     '../../../../dist/bin',
+     '../../../dist/bin',
+     '../../dist/bin',
+     '/bin',
+     '/export/home/buysse/build/expect-5.42.1/cswstage/opt/csw/lib',
+     '/export/home/phil/build/gettext-0.14.1/gettext-tools/intl/.libs',
+     '/export/medusa/kenmays/build/qt-x11-free-3.3.3/lib',
+     '/export/medusa/kenmays/build/s_qt/qt-x11-free-3.3.3/lib',
+     '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/lib',
+     '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/plugins/designer',
+     '/export/medusa/kenmays/build/sparc_qt/qt-x11-free-3.3.4/plugins/sqldrivers',
+     '/home/harpchad/local/sparc/lib',
+     '/lib',
+     '/lib/sparcv9',
+     '/opt/SUNWcluster/lib',
+     '/opt/SUNWmlib/lib',
+     '/opt/SUNWspro/lib',
+     '/opt/SUNWspro/lib/rw7',
+     '/opt/SUNWspro/lib/stlport4',
+     '/opt/SUNWspro/lib/v8',
+     '/opt/SUNWspro/lib/v8plus',
+     '/opt/SUNWspro/lib/v8plusa',
+     '/opt/SUNWspro/lib/v8plusb',
+     '/opt/SUNWspro/lib/v9',
+     '/opt/build/michael/synce-0.8.9-buildroot/opt/csw/lib',
+     '/opt/csw/$ISALIST',
+     '/opt/csw//lib',
+     '/opt/csw/X11/lib',
+     '/opt/csw/X11/lib/',
+     '/opt/csw/X11/lib/$ISALIST',
+     '/opt/csw/X11/lib/64',
+     '/opt/csw/apache2/lib',
+     '/opt/csw/apache2/lib/$ISALIST',
+     '/opt/csw/bdb33/lib',
+     '/opt/csw/bdb33/lib/$ISALIST',
+     '/opt/csw/bdb4/lib',
+     '/opt/csw/bdb4/lib/',
+     '/opt/csw/bdb4/lib/$ISALIST',
+     '/opt/csw/bdb42/lib',
+     '/opt/csw/bdb42/lib/$ISALIST',
+     '/opt/csw/bdb42/lib/64',
+     '/opt/csw/bdb43/lib',
+     '/opt/csw/bdb43/lib/$ISALIST',
+     '/opt/csw/bdb43/lib/64',
+     '/opt/csw/bdb44/lib',
+     '/opt/csw/bdb44/lib/$ISALIST',
+     '/opt/csw/bdb44/lib/64',
+     '/opt/csw/bdb47/lib',
+     '/opt/csw/bdb47/lib/$ISALIST',
+     '/opt/csw/bdb47/lib/64',
+     '/opt/csw/bdb48/lib',
+     '/opt/csw/bdb48/lib/$ISALIST',
+     '/opt/csw/bdb48/lib/64',
+     '/opt/csw/gcc3/lib',
+     '/opt/csw/gcc3/lib/$ISALIST',
+     '/opt/csw/gcc3/lib/.',
+     '/opt/csw/gcc3/lib/sparcv9',
+     '/opt/csw/gcc4/lib',
+     '/opt/csw/gcc4/lib/$ISALIST',
+     '/opt/csw/gcc4/lib/64',
+     '/opt/csw/gcc4/lib/gcj-4.3.3-9',
+     '/opt/csw/gcc4/lib/sparcv9',
+     '/opt/csw/kde-gcc/lib',
+     '/opt/csw/kde-gcc/lib/kde3',
+     '/opt/csw/kde/lib',
+     '/opt/csw/lib',
+     '/opt/csw/lib/',
+     '/opt/csw/lib/$',
+     '/opt/csw/lib/$$ISALIST',
+     '/opt/csw/lib/$ISALIST',
+     '/opt/csw/lib/$ISALIST/ogle',
+     '/opt/csw/lib/-R/opt/csw/lib',
+     '/opt/csw/lib/.',
+     '/opt/csw/lib/32',
+     '/opt/csw/lib/64',
+     '/opt/csw/lib/SALIST',
+     '/opt/csw/lib/X11',
+     '/opt/csw/lib/\\$ISALIST',
+     '/opt/csw/lib/\\SALIST',
+     '/opt/csw/lib/amanda',
+     '/opt/csw/lib/courier-authlib',
+     '/opt/csw/lib/dia',
+     '/opt/csw/lib/evolution/1.4',
+     '/opt/csw/lib/evolution/2.2',
+     '/opt/csw/lib/evolution/2.6',
+     '/opt/csw/lib/evolution/2.8',
+     '/opt/csw/lib/evolution/2.8/components',
+     '/opt/csw/lib/evolution/nss/lib',
+     '/opt/csw/lib/gnopernicus-1.0',
+     '/opt/csw/lib/gnucash',
+     '/opt/csw/lib/graphviz',
+     '/opt/csw/lib/htdig',
+     '/opt/csw/lib/htdig_db',
+     '/opt/csw/lib/lib',
+     '/opt/csw/lib/libsunmath.so',
+     '/opt/csw/lib/mozilla',
+     '/opt/csw/lib/mysql',
+     '/opt/csw/lib/octave-3.0.0',
+     '/opt/csw/lib/ogle',
+     '/opt/csw/lib/perl/5.8.8/CORE',
+     '/opt/csw/lib/purple-2',
+     '/opt/csw/lib/sasl2',
+     '/opt/csw/lib/sparcv8',
+     '/opt/csw/lib/sparcv8plus',
+     '/opt/csw/lib/sparcv8plus+vis',
+     '/opt/csw/lib/sparcv9',
+     '/opt/csw/lib/svn',
+     '/opt/csw/lib/xfce4/modules',
+     '/opt/csw/libexec/firefox/lib/firefox-1.5.0.6',
+     '/opt/csw/libexec/firefox/lib/firefox-1.5.0.7',
+     '/opt/csw/mozilla/firefox/lib',
+     '/opt/csw/mozilla/thunderbird/lib',
+     '/opt/csw/mysql4//lib/mysql',
+     '/opt/csw/mysql4/lib/mysql',
+     '/opt/csw/mysql4/lib/mysql/$ISALIST',
+     '/opt/csw/mysql4/lib/mysql/sparcv9',
+     '/opt/csw/mysql5/lib',
+     '/opt/csw/mysql5/lib/$ISALIST',
+     '/opt/csw/mysql5/lib/$ISALIST/mysql',
+     '/opt/csw/mysql5/lib/64',
+     '/opt/csw/mysql5/lib/64/$ISALIST/mysql',
+     '/opt/csw/mysql5/lib/64/mysql',
+     '/opt/csw/mysql5/lib/mysql',
+     '/opt/csw/mysql5/lib/mysql/$ISALIST',
+     '/opt/csw/nagios/lib',
+     '/opt/csw/nagios/lib/\\$ISALIST',
+     '/opt/csw/openoffice.org/basis3.1/program',
+     '/opt/csw/openoffice.org/ure/lib',
+     '/opt/csw/postgresql/lib',
+     '/opt/csw/postgresql/lib/$ISALIST',
+     '/opt/csw/postgresql/lib/sparcv9',
+     '/opt/csw/ssl/lib',
+     '/opt/cw/gcc3/lib',
+     '/opt/forte8/SUNWspro/lib',
+     '/opt/forte8/SUNWspro/lib/rw7',
+     '/opt/forte8/SUNWspro/lib/rw7/v9',
+     '/opt/forte8/SUNWspro/lib/v8',
+     '/opt/forte8/SUNWspro/lib/v9',
+     '/opt/schily/lib',
+     '/opt/sfw/lib',
+     '/opt/studio/SOS10/SUNWspro/lib',
+     '/opt/studio/SOS10/SUNWspro/lib/rw7',
+     '/opt/studio/SOS10/SUNWspro/lib/v8',
+     '/opt/studio/SOS10/SUNWspro/lib/v8plus',
+     '/opt/studio/SOS11/SUNWspro/lib',
+     '/opt/studio/SOS11/SUNWspro/lib/rw7',
+     '/opt/studio/SOS11/SUNWspro/lib/rw7/v9',
+     '/opt/studio/SOS11/SUNWspro/lib/stlport4',
+     '/opt/studio/SOS11/SUNWspro/lib/stlport4/v9',
+     '/opt/studio/SOS11/SUNWspro/lib/v8',
+     '/opt/studio/SOS11/SUNWspro/lib/v8plus',
+     '/opt/studio/SOS11/SUNWspro/lib/v9',
+     '/opt/studio/SOS8/SUNWspro/lib',
+     '/opt/studio/SOS8/SUNWspro/lib/rw7',
+     '/opt/studio/SOS8/SUNWspro/lib/rw7/v9',
+     '/opt/studio/SOS8/SUNWspro/lib/v8',
+     '/opt/studio/SOS8/SUNWspro/lib/v8plusa',
+     '/opt/studio/SOS8/SUNWspro/lib/v9',
+     '/opt/studio10/SUNWspro/lib',
+     '/opt/studio10/SUNWspro/lib/rw7',
+     '/opt/studio10/SUNWspro/lib/rw7/v9',
+     '/opt/studio10/SUNWspro/lib/stlport4',
+     '/opt/studio10/SUNWspro/lib/stlport4/v9',
+     '/opt/studio10/SUNWspro/lib/v8',
+     '/opt/studio10/SUNWspro/lib/v9',
+     '/oracle/product/9.2.0/lib32',
+     '/usr/X/lib',
+     '/usr/ccs/lib',
+     '/usr/ccs/lib/sparcv9',
+     '/usr/dt/lib',
+     '/usr/lib',
+     '/usr/lib/sparcv9',
+     '/usr/local/lib',
+     '/usr/local/openldap-2.3/lib',
+     '/usr/openwin/lib',
+     '/usr/sfw/lib',
+     '/usr/ucblib',
+     '/usr/xpg4/lib',
+     'RIGIN/../lib'])

Added: csw/mgar/gar/v2/lib/python/testdata/stats/46/461a24f02dd5020b4aa014b76f3ec2cc/ldd_dash_r.yml
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/stats/46/461a24f02dd5020b4aa014b76f3ec2cc/ldd_dash_r.yml	                        (rev 0)
+++ csw/mgar/gar/v2/lib/python/testdata/stats/46/461a24f02dd5020b4aa014b76f3ec2cc/ldd_dash_r.yml	2010-03-27 02:29:30 UTC (rev 9396)
@@ -0,0 +1 @@
+[]


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