[csw-devel] SF.net SVN: gar:[20027] csw/mgar/gar/v2
chninkel at users.sourceforge.net
chninkel at users.sourceforge.net
Fri Jan 4 20:40:06 CET 2013
Revision: 20027
http://gar.svn.sourceforge.net/gar/?rev=20027&view=rev
Author: chninkel
Date: 2013-01-04 19:40:05 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
gar/v2: added new checkpkg tests: soname-unused, no-direct-binding and forbidden-version-interface-dependencies
Modified Paths:
--------------
csw/mgar/gar/v2/lib/map.solaris10u8
csw/mgar/gar/v2/lib/python/common_constants.py
csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
csw/mgar/gar/v2/lib/python/database.py
csw/mgar/gar/v2/lib/python/dependency_checks.py
csw/mgar/gar/v2/lib/python/inspective_package.py
csw/mgar/gar/v2/lib/python/inspective_package_test.py
csw/mgar/gar/v2/lib/python/package.py
csw/mgar/gar/v2/lib/python/package_checks_test.py
csw/mgar/gar/v2/lib/python/package_stats.py
csw/mgar/gar/v2/lib/python/package_stats_test.py
csw/mgar/gar/v2/lib/python/pkgdb.py
csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py
csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py
csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py
csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py
csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py
csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py
csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py
csw/mgar/gar/v2/lib/python/testdata/neon_stats.py
csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py
csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py
csw/mgar/gar/v2/lib/python/testdata/tree_stats.py
Added Paths:
-----------
csw/mgar/gar/v2/lib/python/testdata/cadaver_stats.py
csw/mgar/gar/v2/lib/python/testdata/vsftpd_stats.py
Removed Paths:
-------------
csw/mgar/gar/v2/lib/map.solaris10
Property Changed:
----------------
csw/mgar/gar/v2/
Property changes on: csw/mgar/gar/v2
___________________________________________________________________
Modified: svn:mergeinfo
- /csw/mgar/gar/v2:4936-6678
/csw/mgar/gar/v2-bwalton:9784-10011
/csw/mgar/gar/v2-checkpkg:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation:10585-10737
/csw/mgar/gar/v2-checkpkg-stats:8454-8649
/csw/mgar/gar/v2-collapsed-modulations:6895
/csw/mgar/gar/v2-defaultchange:13903-14022
/csw/mgar/gar/v2-dirpackage:8125-8180
/csw/mgar/gar/v2-fortran:10883-12516
/csw/mgar/gar/v2-git/v2-relocate:7617
/csw/mgar/gar/v2-migrateconf:7082-7211
/csw/mgar/gar/v2-noexternals:11592-11745
/csw/mgar/gar/v2-raised-buildlevel:15906-15949
/csw/mgar/gar/v2-relocate:5028-11738
/csw/mgar/gar/v2-skayser:6087-6132
/csw/mgar/gar/v2-solaris11:18134-18236
/csw/mgar/gar/v2-sqlite:10434-10449
/csw/mgar/gar/v2-uwatch2:12141-13270
+ /csw/mgar/gar/v2:4936-6678
/csw/mgar/gar/v2-bwalton:9784-10011
/csw/mgar/gar/v2-checkpkg:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation:10585-10737
/csw/mgar/gar/v2-checkpkg-stats:8454-8649
/csw/mgar/gar/v2-collapsed-modulations:6895
/csw/mgar/gar/v2-defaultchange:13903-14022
/csw/mgar/gar/v2-dirpackage:8125-8180
/csw/mgar/gar/v2-fortran:10883-12516
/csw/mgar/gar/v2-git/v2-relocate:7617
/csw/mgar/gar/v2-migrateconf:7082-7211
/csw/mgar/gar/v2-noexternals:11592-11745
/csw/mgar/gar/v2-raised-buildlevel:15906-15949
/csw/mgar/gar/v2-relocate:5028-11738
/csw/mgar/gar/v2-skayser:6087-6132
/csw/mgar/gar/v2-solaris11:18134-18236
/csw/mgar/gar/v2-sqlite:10434-10449
/csw/mgar/gar/v2-uwatch2:12141-13270
/csw/mgar/gar/v2-yann:19236-20023
Deleted: csw/mgar/gar/v2/lib/map.solaris10
===================================================================
--- csw/mgar/gar/v2/lib/map.solaris10 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/map.solaris10 2013-01-04 19:40:05 UTC (rev 20027)
@@ -1,7 +0,0 @@
-# Solaris 10 mapfile with libc Version 1.22.2 which is Update?? Kernel Version
-# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/mapfile-vers#301
-libc.so - SUNW_1.22.2 SUNWprivate_1.1 $ADDVERS=SUNW_1.22.2;
-# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libresolv2/common/mapfile-vers
-libresolv.so - SUNW_2.2.2 SUNWprivate_2.1 $ADDVERS=SUNW_2.2.2;
-# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libnsl/common/mapfile-vers
-libnsl.so - SUNW_1.9.1 SUNWprivate_1.5 $ADDVERS=SUNW_1.9.1;
Modified: csw/mgar/gar/v2/lib/map.solaris10u8
===================================================================
--- csw/mgar/gar/v2/lib/map.solaris10u8 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/map.solaris10u8 2013-01-04 19:40:05 UTC (rev 20027)
@@ -2,6 +2,6 @@
# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/mapfile-vers#301
libc.so - SUNW_1.22.5 SUNWprivate_1.1 $ADDVERS=SUNW_1.22.5;
# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libresolv2/common/mapfile-vers
-libresolv.so - SUNW_2.2 SUNWprivate_2.1 $ADDVERS=SUNW_2.2;
+libresolv.so - SUNW_2.2.1 SUNWprivate_2.1 $ADDVERS=SUNW_2.2.1;
# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libnsl/common/mapfile-vers
libnsl.so - SUNW_1.9.1 SUNWprivate_1.5 $ADDVERS=SUNW_1.9.1;
Modified: csw/mgar/gar/v2/lib/python/common_constants.py
===================================================================
--- csw/mgar/gar/v2/lib/python/common_constants.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/common_constants.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -34,6 +34,7 @@
DEFAULT_INSTALL_CONTENTS_FILE = "/var/sadm/install/contents"
DUMP_BIN = "/usr/ccs/bin/dump"
+ELFDUMP_BIN = "/usr/ccs/bin/elfdump"
OWN_PKGNAME_PREFIXES = frozenset(["CSW"])
Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -1,4 +1,4 @@
-#!/opt/csw/bin/python2.6
+#!/usr/bin/env python2.6
"""csw_upload_pkg.py - uploads packages to the database.
@@ -55,6 +55,15 @@
{{dublin,unstable,kiel,bratislava}}x{{sparc,i386}}x{{5.8,5.9.5.10,5.11}}
+= Removing packages from the catalog =
+
+The --remove option works the same way as the regular use, except that it
+removes assignments of a given package to catalogs, instead of adding them.
+
+When removing packages from catalogs, files on disk are passed as arguments.
+On the buildfarm, all files are available under the /home/mirror/opencsw
+directory.
+
For more information, see:
http://wiki.opencsw.org/automated-release-process#toc0
"""
@@ -177,7 +186,7 @@
planned_modifications.append(
(filename, md5_sum,
arch, osrel, cat_arch, cat_osrel))
- # The plan:
+ # The plan:
# - Create groups of files to be inserted into each of the catalogs
# - Invoke checkpkg to check every target catalog
checkpkg_sets = self._CheckpkgSets(planned_modifications)
@@ -190,6 +199,66 @@
file_metadata = metadata_by_md5[md5_sum]
self._InsertIntoCatalog(filename, arch, osrel, file_metadata)
+ def Remove(self):
+ for filename in self.filenames:
+ self._RemoveFile(filename)
+
+ def _RemoveFile(self, filename):
+ md5_sum = self._GetFileMd5sum(filename)
+ file_in_allpkgs, file_metadata = self._GetSrv4FileMetadata(md5_sum)
+ if not file_metadata:
+ logging.warning("Could not find metadata for file %s", repr(filename))
+ return
+ osrel = file_metadata['osrel']
+ arch = file_metadata['arch']
+ catalogs = self._MatchSrv4ToCatalogs(
+ filename, DEFAULT_CATREL, arch, osrel, md5_sum)
+ for unused_catrel, cat_arch, cat_osrel in sorted(catalogs):
+ self._RemoveFromCatalog(filename, cat_arch, cat_osrel, file_metadata)
+
+ def _RemoveFromCatalog(self, filename, arch, osrel, file_metadata):
+ print("Removing %s (%s %s) from catalog %s %s %s"
+ % (file_metadata["catalogname"],
+ file_metadata["arch"],
+ file_metadata["osrel"],
+ DEFAULT_CATREL, arch, osrel))
+ md5_sum = self._GetFileMd5sum(filename)
+ basename = os.path.basename(filename)
+ parsed_basename = opencsw.ParsePackageFileName(basename)
+ # TODO: Move this bit to a separate class (RestClient)
+ url = (
+ "%s%s/catalogs/%s/%s/%s/%s/"
+ % (self.rest_url,
+ RELEASES_APP,
+ DEFAULT_CATREL,
+ arch,
+ osrel,
+ md5_sum))
+ logging.debug("DELETE @ URL: %s %s", type(url), url)
+ c = pycurl.Curl()
+ d = StringIO()
+ h = StringIO()
+ c.setopt(pycurl.URL, str(url))
+ c.setopt(pycurl.CUSTOMREQUEST, "DELETE")
+ c.setopt(pycurl.WRITEFUNCTION, d.write)
+ c.setopt(pycurl.HEADERFUNCTION, h.write)
+ c.setopt(pycurl.HTTPHEADER, ["Expect:"]) # Fixes the HTTP 417 error
+ c = self._SetAuth(c)
+ if self.debug:
+ c.setopt(c.VERBOSE, 1)
+ c.perform()
+ http_code = c.getinfo(pycurl.HTTP_CODE)
+ logging.debug(
+ "DELETE curl getinfo: %s %s %s",
+ type(http_code),
+ http_code,
+ c.getinfo(pycurl.EFFECTIVE_URL))
+ c.close()
+ if not (http_code >= 200 and http_code <= 299):
+ raise RestCommunicationError(
+ "%s - HTTP code: %s, content: %s"
+ % (url, http_code, d.getvalue()))
+
def _GetFileMd5sum(self, filename):
if filename not in self.md5_by_filename:
logging.debug("_GetFileMd5sum(%s): Reading the file", filename)
@@ -453,6 +522,10 @@
parser.add_option("-d", "--debug",
dest="debug",
default=False, action="store_true")
+ parser.add_option("--remove",
+ dest="remove",
+ default=False, action="store_true",
+ help="Remove packages from catalogs instead of adding them")
parser.add_option("--os-release",
dest="os_release",
help="If specified, only uploads to the specified OS release. "
@@ -513,4 +586,7 @@
username=username,
password=password,
catrel=options.catrel)
- uploader.Upload()
+ if options.remove:
+ uploader.Remove()
+ else:
+ uploader.Upload()
Modified: csw/mgar/gar/v2/lib/python/database.py
===================================================================
--- csw/mgar/gar/v2/lib/python/database.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/database.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -10,7 +10,7 @@
import system_pkgmap
CONFIG_DB_SCHEMA = "db_schema_version"
-DB_SCHEMA_VERSION = 7L
+DB_SCHEMA_VERSION = 8L
TABLES_THAT_NEED_UPDATES = (m.CswFile,)
TABLES = TABLES_THAT_NEED_UPDATES + (
m.Architecture,
@@ -159,8 +159,8 @@
except sqlobject.dberrors.OperationalError, e:
logging.error("Could not create table %r: %s", table, e)
raise
-
+
def InitialDataImport(self):
"""Imports initial data into the db.
@@ -289,7 +289,7 @@
logging.warning("Could not get file mtime: %s", e)
d_mtime = time.gmtime(int(d_mtime_epoch))
logging.debug("IsDatabaseUpToDate: f_mtime %s, d_time: %s", f_mtime, d_mtime)
- # Rounding up to integer seconds. There is a race condition:
+ # Rounding up to integer seconds. There is a race condition:
# pkgadd finishes at 100.1
# checkpkg reads /var/sadm/install/contents at 100.2
# new pkgadd runs and finishes at 100.3
Modified: csw/mgar/gar/v2/lib/python/dependency_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/dependency_checks.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -29,20 +29,44 @@
)
DEPENDENCY_FILENAME_REGEXES = (
- (r".*\.pl$", (u"CSWperl",)),
- (r".*\.pm$", (u"CSWperl",)),
- (r".*\.py$", (u"CSWpython",)),
- (r".*\.rb$", (u"CSWruby", u"CSWruby18", u"CSWruby191", u"CSWlibruby1-9-1-1")),
+ (r".*\.pl$", (u"CSWperl",)),
+ (r".*\.pm$", (u"CSWperl",)),
+ (r".*\.py$", (u"CSWpython",)),
+ (r".*\.rb$", (u"CSWruby", u"CSWruby18",
+ u"CSWruby191", u"CSWlibruby1-9-1-1")),
(r".*\.elc?$", (u"CSWemacscommon",)),
(r"/opt/csw/apache2/", (u"CSWapache2",)),
)
PREFERRED_DIRECTORY_PROVIDERS = set([u"CSWcommon"])
+BASE_SOLARIS_LIBRARIES = (
+ "libsocket.so.1", "libnsl.so.1", "libdl.so.1", "librt.so.1",
+ "libresolv.so.2", "libpthread.so.1",
+ # linked by default with C++, see "Default C++ Libraries"
+ # in Solaris Studio C++ User's Guide
+ "libCstd.so.1", "libCrun.so.1", "libm.so.1", "libm.so.2",
+ "libw.so.1", "libcx.so.1", "libc.so.1", "libC.so.3", "libC.so.5",
+)
+
+ALLOWED_VERSION_DEPENDENCIES = {
+ "libc.so.1": ['SYSVABI_1.3', 'SUNWprivate_1.1', 'SUNW_1.22.6',
+ 'SUNW_1.22.5', 'SUNW_1.22.4', 'SUNW_1.22.3', 'SUNW_1.22.2',
+ 'SUNW_1.22.1', 'SUNW_1.22', 'SUNW_1.21.3', 'SUNW_1.21.2',
+ 'SUNW_1.21.1', 'SUNW_1.21', 'SUNW_1.20.4', 'SUNW_1.20.1',
+ 'SUNW_1.20', 'SUNW_1.19', 'SUNW_1.18.1', 'SUNW_1.18',
+ 'SUNW_1.17', 'SUNW_1.16', 'SUNW_1.15', 'SUNW_1.14',
+ 'SUNW_1.13', 'SUNW_1.12', 'SUNW_1.11', 'SUNW_1.10',
+ 'SUNW_1.9', 'SUNW_1.8', 'SUNW_1.7', 'SUNW_1.6', 'SUNW_1.5',
+ 'SUNW_1.4', 'SUNW_1.3', 'SUNW_1.2', 'SUNW_1.1', 'SUNW_0.9',
+ 'SUNW_0.8', 'SUNW_0.7', 'SISCD_2.3'],
+}
+
+
def ProcessSoname(
ldd_emulator,
- soname, path_and_pkg_by_basename, binary_info, isalist, binary_path, logger,
- error_mgr,
+ soname, path_and_pkg_by_basename, binary_info, isalist, binary_path,
+ logger, error_mgr,
pkgname, messenger):
"""This is not an ideal name for this function.
@@ -143,10 +167,71 @@
for soname in binary_info["needed sonames"]:
orphan_sonames_tmp = ProcessSoname(
ldd_emulator,
- soname, path_and_pkg_by_basename, binary_info, isalist, binary_path, logger,
- error_mgr,
+ soname, path_and_pkg_by_basename, binary_info, isalist, binary_path,
+ logger, error_mgr,
pkgname, messenger)
orphan_sonames.extend(orphan_sonames_tmp)
+
+ ldd_info = pkg_data['ldd_info'][binary_info["path"]]
+ for ldd_response in ldd_info:
+ if (ldd_response['state'] == 'soname-unused'
+ and ldd_response['soname'] not in BASE_SOLARIS_LIBRARIES):
+ messenger.Message(
+ "Binary %s links to library %s but doesn't seem to use any"
+ " of its symbols. It usually happens because superfluous"
+ " libraries were added to the linker options, either because"
+ " of the configure script itself or because of the"
+ " \"pkg-config --libs\" output of one the dependency."
+ % ("/" + binary_info["path"], ldd_response['soname']))
+ error_mgr.ReportError(
+ pkgname, "soname-unused",
+ "%s is needed by %s but never used"
+ % (ldd_response['soname'], "/" + binary_info["path"]))
+
+ # Even when direct binding is enabled, some symbols might not be
+ # directly bound because the library explicitely requested the symbol
+ # not to be drectly bound to.
+ # For example, libc.so.1 does it for symbol sigaction, free, malloc...
+ # So we consider that direct binding is enabled if at least one
+ # symbol is directly bound to because that definitely means that
+ # -B direct or -z direct was used.
+ binary_elf_info = pkg_data["binaries_elf_info"][binary_info["path"]]
+ db_libs = set()
+ for syminfo in binary_elf_info['symbol table']:
+ if (syminfo['shndx'] == 'UNDEF' and syminfo['flags']
+ and 'D' in syminfo['flags'] and 'B' in syminfo['flags']):
+ db_libs.add(syminfo['soname'])
+ no_db_libs = db_libs.symmetric_difference(binary_info["needed sonames"])
+
+ if no_db_libs:
+ messenger.Message(
+ "No symbol of binary %s is directly bound against the following"
+ " libraries: %s. Please make sure the binaries are compiled using"
+ " the \"-Bdirect\" linker option."
+ % ("/" + binary_info["path"], ", ".join(no_db_libs)))
+ for soname in no_db_libs:
+ error_mgr.ReportError(
+ pkgname, "no-direct-binding",
+ "%s is not directly bound to soname %s"
+ % ("/" + binary_info["path"], soname))
+
+
+ for version_dep in binary_elf_info['version needed']:
+ if (version_dep['soname'] in ALLOWED_VERSION_DEPENDENCIES and
+ not version_dep['version'] in
+ ALLOWED_VERSION_DEPENDENCIES[version_dep['soname']]):
+ messenger.Message(
+ "Binary %s requires interface version %s in library %s which is"
+ " only available in recent Solaris releases."
+ % ("/" + binary_info["path"], version_dep['version'],
+ version_dep['soname']))
+ error_mgr.ReportError(
+ pkgname, "forbidden-version-interface-dependencies",
+ "%s requires forbidden interface version %s in library %s"
+ % ("/" + binary_info["path"], version_dep['version'],
+ version_dep['soname']))
+
+
orphan_sonames = set(orphan_sonames)
for soname, binary_path in orphan_sonames:
if soname not in ALLOWED_ORPHAN_SONAMES:
@@ -191,8 +276,8 @@
needed_dirs.add(base_dir)
for needed_dir in needed_dirs:
reason_group = []
- # TODO: The preferred directory providers should not depend on other packages to
- # provide directories.
+ # TODO: The preferred directory providers should not depend on other
+ # packages to provide directories.
if pkgname not in PREFERRED_DIRECTORY_PROVIDERS:
# If the path is provided by CSWcommon or other preferred package, don't
# mention other packages.
@@ -206,7 +291,8 @@
if not pkg_by_path[needed_dir]:
# There's no sense in reporting '/' and ''.
if needed_dir and needed_dir != '/':
- error_mgr.ReportError(pkgname, "base-dir-not-found", repr(needed_dir))
+ error_mgr.ReportError(pkgname, "base-dir-not-found",
+ repr(needed_dir))
elif len(pkg_by_path[needed_dir]) < 5:
pkgs_to_mention = pkg_by_path[needed_dir]
else:
@@ -218,7 +304,8 @@
if reason_group:
req_pkgs_reasons.append(reason_group)
else:
- error_mgr.ReportError(pkgname, "base-dir-not-provided-by-any-package", needed_dir)
+ error_mgr.ReportError(pkgname, "base-dir-not-provided-by-any-package",
+ needed_dir)
return req_pkgs_reasons
@@ -232,6 +319,7 @@
error_mgr.GetPathsAndPkgnamesByBasename(basename))
return path_and_pkg_by_basename
+
def GetPkgByFullPath(error_mgr, logger, paths_to_verify, pkg_by_path):
"""Resolves a list of paths to a mapping between paths and packages.
@@ -242,11 +330,13 @@
for path in paths_to_verify:
if path not in pkg_by_path:
result = error_mgr.GetPkgByPath(path)
- # logger.warning("error_mgr.GetPkgByPath(%s) => %s", repr(path), repr(result))
+ # logger.warning("error_mgr.GetPkgByPath(%s) => %s", repr(path),
+ # repr(result))
pkg_by_path[path] = result
# logger.warning("New paths: %s" % pprint.pformat(pkg_by_path))
return pkg_by_path
+
def SuggestLibraryPackage(error_mgr, messenger,
pkgname, catalogname,
description,
Modified: csw/mgar/gar/v2/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/inspective_package.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -10,6 +10,8 @@
import subprocess
import ldd_emul
import configuration as c
+import time
+import signal
"""This file isolates code dependent on hachoir parser.
@@ -35,7 +37,7 @@
return {}
file_info = {
"path": StripRe(file_path, ROOT_RE),
- "mime_type": file_magic.GetFileMimeType(full_path)
+ "mime_type": file_magic.GetFileMimeType(full_path),
}
if base_dir:
file_info["path"] = os.path.join(base_dir, file_info["path"])
@@ -76,7 +78,37 @@
"Error in hachoir_parser processing %s: %r", file_path, e)
return file_info
+class TimeoutExpired(Exception):
+ pass
+def TimeoutHandler(signum, frame):
+ raise TimeoutExpired
+
+def ShellCommand(args, env=None, timeout=None):
+ logging.debug("Running: %s", args)
+ proc = subprocess.Popen(args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=env,
+ preexec_fn=os.setsid)
+ # Python 3.3 have the timeout option
+ # we have to roughly emulate it with python 2.x
+ if timeout:
+ signal.signal(signal.SIGALRM, TimeoutHandler)
+ signal.alarm(timeout)
+
+ try:
+ stdout, stderr = proc.communicate()
+ signal.alarm(0)
+ except TimeoutExpired:
+ os.kill(-proc.pid, signal.SIGKILL)
+ msg = "Process %s killed after timeout expiration" % args
+ raise TimeoutExpired(msg)
+
+ retcode = proc.wait()
+ return retcode, stdout, stderr
+
+
class InspectivePackage(package.DirectoryFormatPackage):
"""Extends DirectoryFormatPackage to allow package inspection."""
@@ -160,7 +192,8 @@
return os.path.exists(os.path.join(self.directory, "reloc"))
def GetFilesDir(self):
- """Returns the subdirectory in which files, are either "reloc" or "root"."""
+ """Returns the subdirectory in which files are,
+ either "reloc" or "root"."""
if self.RelocPresent():
return "reloc"
else:
@@ -181,13 +214,11 @@
if basedir:
binary_in_tmp_dir = binary_in_tmp_dir[len(basedir):]
binary_in_tmp_dir = binary_in_tmp_dir.lstrip("/")
- binary_abs_path = os.path.join(self.directory, self.GetFilesDir(), binary_in_tmp_dir)
+ binary_abs_path = os.path.join(self.directory, self.GetFilesDir(),
+ binary_in_tmp_dir)
binary_base_name = os.path.basename(binary_in_tmp_dir)
args = [common_constants.DUMP_BIN, "-Lv", binary_abs_path]
- logging.debug("Running: %s", args)
- dump_proc = subprocess.Popen(args, stdout=subprocess.PIPE, env=env)
- stdout, stderr = dump_proc.communicate()
- ret = dump_proc.wait()
+ retcode, stdout, stderr = ShellCommand(args, env)
binary_data = ldd_emul.ParseDumpOutput(stdout)
binary_data["path"] = binary
if basedir:
@@ -211,7 +242,7 @@
defined_symbols = {}
for binary in binaries:
- binary_abspath = os.path.join(self.directory, "root", binary)
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
# Get parsable, ld.so.1 relevant SHT_DYNSYM symbol information
args = ["/usr/ccs/bin/nm", "-p", "-D", binary_abspath]
nm_proc = subprocess.Popen(
@@ -236,41 +267,268 @@
return defined_symbols
+ def GetBinaryElfInfo(self):
+ """Returns various informations symbol and versions present in elf header
+
+ To do this we parse output lines from elfdump -syv, it's the
+ only command that will give us all informations we need on
+ symbols and versions.
+
+ We will analyse 3 sections:
+ - version section: contains soname needed, version interface required
+ for each soname, and version definition
+ - symbol table section: contains list of symbol and soname/version
+ interface providing it
+ - syminfo section: contains special linking flags for each symbol
+ """
+ binaries = self.ListBinaries()
+ binaries_elf_info = {}
+
+ for binary in binaries:
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
+ # elfdump is the only tool that give us all informations
+ args = [common_constants.ELFDUMP_BIN, "-svy", binary_abspath]
+ retcode, stdout, stderr = ShellCommand(args)
+ if retcode or stderr:
+ # we ignore for now these elfdump errors which can be catched
+ # later by check functions,
+ ignored_error_re = re.compile(
+ r"""[^:]+:(\s\.((SUNW_l)?dynsym|symtab):\s
+ (index\[\d+\]:\s
+ (suspicious\s(local|global)\ssymbol\sentry:\s[^:]+:\slies
+ \swithin\s(local|global)\ssymbol\srange\s\(index\s[<>=]+\s\d+\)
+
+ |bad\ssymbol\sentry:\s[^:]+:\ssection\[\d+\]\ssize:\s0(x[0-9a-f]+)?
+ :\ssymbol\s\(address\s0x[0-9a-f]+,\ssize\s0x[0-9a-f]+\)
+ \slies\soutside\sof\scontaining\ssection
+
+ |bad\ssymbol\sentry:\s:\sinvalid\sshndx:\s\d+)
+
+ |invalid\ssh_link:\s0)
+
+ |\smemory\soverlap\sbetween\ssection\[\d+\]:\s[^:]+:\s
+ [0-9a-f]+:[0-9a-f]+\sand\ssection\[\d+\]:\s[^:]+:
+ \s[0-9a-f]+:[0-9a-f]+)
+ \n""",
+ re.VERBOSE)
+
+ stderr = re.sub(ignored_error_re, "", stderr)
+ if stderr:
+ msg = "%s returned one or more errors: %s" % (args, stderr)
+ raise package.Error(msg)
+ elfdump_out = stdout.splitlines()
+
+ symbols = {}
+ binary_info = {'version definition': [],
+ 'version needed': []}
+
+ cur_section = None
+ for line in elfdump_out:
+
+ elf_info, cur_section = self._ParseElfdumpLine(line, cur_section)
+
+ # header or blank line contains no information
+ if not elf_info:
+ continue
+
+ # symbol table and syminfo section store various informations
+ # about the same symbols, so we merge them in a dict
+ if cur_section in ('symbol table', 'syminfo'):
+ symbols.setdefault(elf_info['symbol'], {}).update(elf_info)
+ else:
+ binary_info[cur_section].append(elf_info)
+
+ # elfdump doesn't repeat the name of the soname in the version section
+ # if it's the same on two contiguous line, e.g.:
+ # libc.so.1 SUNW_1.1
+ # SUNWprivate_1.1
+ # so we have to make sure the information is present in each entry
+ for i, version in enumerate(binary_info['version needed'][1:]):
+ if not version['soname']:
+ version['soname'] = binary_info['version needed'][i]['soname']
+
+ # soname version needed are usually displayed sorted by index ...
+ # but that's not always the case :( so we have to reorder
+ # the list by index if they are present
+ if any ( v['index'] for v in binary_info['version needed'] ):
+ binary_info['version needed'].sort(key=lambda m: int(m['index']))
+ for version in binary_info['version needed']:
+ del version['index']
+
+ # if it exists, the first "version definition" entry is the base soname
+ # we don't need this information
+ if binary_info['version definition']:
+ binary_info['version definition'].pop(0)
+
+ binary_info['symbol table'] = symbols.values()
+ binary_info['symbol table'].sort(key=lambda m: m['symbol'])
+ # To not rely of the section order output of elfdump, we resolve
+ # symbol version informations here after having parsed all output
+ self._ResolveSymbolsVersionInfo(binary_info)
+
+ binaries_elf_info[binary] = binary_info
+
+ return binaries_elf_info
+
def GetLddMinusRlines(self):
"""Returns ldd -r output."""
- dir_pkg = self.GetInspectivePkg()
- binaries = dir_pkg.ListBinaries()
+ binaries = self.ListBinaries()
ldd_output = {}
for binary in binaries:
- binary_abspath = os.path.join(dir_pkg.directory, "root", binary)
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
# this could be potentially moved into the DirectoryFormatPackage class.
# ldd needs the binary to be executable
os.chmod(binary_abspath, 0755)
- args = ["ldd", "-r", binary_abspath]
- ldd_proc = subprocess.Popen(
- args,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- stdout, stderr = ldd_proc.communicate()
- retcode = ldd_proc.wait()
+ args = ["ldd", "-Ur", binary_abspath]
+ # ldd can be stuck while ran on a some binaries, so we define
+ # a timeout (problem encountered with uconv)
+ retcode, stdout, stderr = ShellCommand(args, timeout=10)
if retcode:
- logging.error("%s returned an error: %s", args, stderr)
+ # There three cases where we will ignore an ldd error
+ # - if we are trying to analyze a 64 bits binary on a Solaris 9 x86
+ # solaris 9 exists only in 32 bits, so we can't do this
+ # We ignore the error as it is likely that the ldd infos will be
+ # the same on the 32 bits binaries
+ # - if we are trying to analyze a binary from another architecture
+ # we ignore this error as it will be caught by another checkpkg test
+ # - if we are trying to analyze a statically linked binaries
+ # we care only about dynamic binary so we ignore the error
+ #
+ uname_info = os.uname()
+ if ((uname_info[2] == '5.9' and uname_info[4] == 'i86pc' and
+ '/amd64/' in binary_abspath and
+ 'has wrong class or data encoding' in stderr) or
+ re.search(r'ELF machine type: EM_\w+: '
+ r'is incompatible with system', stderr)
+ or 'file is not a dynamic executable or shared object' in stderr):
+ ldd_output[binary] = []
+ continue
+
+ raise package.Error("%s returned an error: %s" % (args, stderr))
+
ldd_info = []
for line in stdout.splitlines():
- ldd_info.append(self._ParseLddDashRline(line))
- ldd_output[binary] = ldd_info
+ result = self._ParseLddDashRline(line, binary_abspath)
+ if result:
+ ldd_info.append(result)
+ ldd_output[binary] = ldd_info
+
return ldd_output
def _ParseNmSymLine(self, line):
- re_defined_symbol = re.compile('[0-9]+ [ABDFNSTU] \S+')
+ re_defined_symbol = re.compile('[0-9]+ [ABDFNSTU] \S+')
m = re_defined_symbol.match(line)
if not m:
return None
fields = line.split()
- sym = { 'address': fields[0], 'type': fields[1], 'name': fields[2] }
+ sym = {'address': fields[0], 'type': fields[1], 'name': fields[2]}
return sym
- def _ParseLddDashRline(self, line):
+ def _ResolveSymbolsVersionInfo(self, binary_info):
+
+ version_info = (binary_info['version definition']
+ + binary_info['version needed'])
+
+ for sym_info in binary_info['symbol table']:
+ # sym_info version field is an 1-based index on the version
+ # information table
+ # we don't care about 0 and 1 values:
+ # 0 is for external symbol with no version information available
+ # 1 is for a symbol defined by the binary and not binded
+ # to a version interface
+ version_index = int(sym_info['version']) - 2
+ if version_index >= 0:
+ version = version_info[version_index]
+ sym_info['version'] = version['version']
+ if 'soname' in version:
+ sym_info['soname'] = version['soname']
+ else:
+ sym_info['version'] = None
+
+ # we make sure these fields are present
+ # even if the syminfo section is not
+ sym_info.setdefault('soname')
+ sym_info.setdefault('flags')
+
+ def _ParseElfdumpLine(self, line, section=None):
+
+ headers_re = (
+ r"""
+ (?P<section>Version\sNeeded|Symbol\sTable # Section header
+ |Version\sDefinition|Syminfo)
+ \sSection:
+ \s+(?:\.SUNW_version|\.gnu\.version_[rd]
+ |\.dynsym|\.SUNW_syminfo|.symtab)\s*$
+
+ |\s*(?:index\s+)?version\s+dependency\s*$ # Version needed header
+
+ |\s*(?:index\s+)?file\s+version\s*$ # Version definition header
+
+ |\s*index\s*value\s+size\s+type\s+bind # Symbol table header
+ \s+oth\s+ver\s+shndx\s+name\s*$
+
+ |\s*index\s+flags\s+bound\sto\s+symbol\s*$ # Syminfo header
+
+ |\s*$ # There is always a blank
+ # line before a new section
+ """)
+
+ re_by_section = {
+ 'version definition': (r"""
+ \s*(?:\[\d+\]\s+)? # index: might be not present if no
+ # version binding is enabled
+ (?P<version>\S+) # version
+ (?:\s+(?P<dependency>\S+))? # dependency
+ (?:\s+\[\s(?:BASE|WEAK)\s\])?\s*$
+ """),
+ 'version needed': (r"""
+ \s*(?:\[(?P<index>\d+)\]\s+)? # index: might be not present if no
+ # version binding is enabled
+ (?:(?P<soname>\S+)\s+ # file: can be absent if the same as
+ (?!\[\s(?:INFO|WEAK)\s\]))? # the previous line,
+ # we make sure there is no
+ # confusion with version
+ (?P<version>\S+) # version
+ (?:\s+\[\s(?:INFO|WEAK)\s\])?\s*$ #
+ """),
+ 'symbol table': (r"""
+ \s*\[\d+\] # index
+ \s+(?:0x[0-9a-f]+|REG_G\d+) # value
+ \s+(?:0x[0-9a-f]+) # size
+ \s+(?P<type>\S+) # type
+ \s+(?P<bind>\S+) # bind
+ \s+(?:\S+) # oth
+ \s+(?P<version>\S+) # ver
+ \s+(?P<shndx>\S+) # shndx
+ (?:\s+(?P<symbol>\S+))?\s*$ # name
+ """),
+ 'syminfo': (r"""
+ \s*(?:\[\d+\]) # index
+ \s+(?P<flags>[ABCDFILNPS]+) # flags
+
+ \s+(?:(?:\[\d+\] # bound to: contains either
+ \s+(?P<soname>\S+)|<self>)\s+)? # - library index and library name
+ # - <self> for non external symbols
+
+ (?P<symbol>\S+)\s* # symbol
+ """)}
+
+ elfdump_data = None
+ m = re.match(headers_re, line, re.VERBOSE)
+ if m:
+ if m.lastindex:
+ section = m.group('section').lower()
+ elif section:
+ m = re.match(re_by_section[section], line, re.VERBOSE)
+ if m:
+ elfdump_data = m.groupdict()
+
+ if not m:
+ raise package.StdoutSyntaxError("Could not parse %s" % (repr(line)))
+
+ return elfdump_data, section
+
+ def _ParseLddDashRline(self, line, binary=None):
found_re = r"^\t(?P<soname>\S+)\s+=>\s+(?P<path_found>\S+)"
symbol_not_found_re = (r"^\tsymbol not found:\s(?P<symbol>\S+)\s+"
r"\((?P<path_not_found>\S+)\)")
@@ -283,16 +541,35 @@
r'with STV_PROTECTED visibility$')
sizes_differ = (r'^\trelocation \S+ sizes differ: '
r'(?P<sizes_differ_symbol>\S+)$')
- sizes_info = (r'^\t\t\(file (?P<sizediff_file1>\S+) size=(?P<size1>0x\w+); '
+ sizes_info = (r'^\t\t\(file (?P<sizediff_file1>\S+)'
+ r' size=(?P<size1>0x\w+); '
r'file (?P<sizediff_file2>\S+) size=(?P<size2>0x\w+)\)$')
sizes_one_used = (r'^\t\t(?P<sizediffused_file>\S+) size used; '
r'possible insufficient data copied$')
- common_re = (r"(%s|%s|%s|%s|%s|%s|%s|%s)"
+ unreferenced_object = (r'^\s*unreferenced object=(?P<object>.*);'
+ r' unused dependency of (?P<binary>.*)$')
+ unused_object = (r'^\s*unused object=.*$')
+ unused_search_path = (r'^\s*unused search path=.*'
+ r' \(RUNPATH/RPATH from file .*\)$')
+ move_offset_error = (r'^\tmove (?P<move_index>\d+) offset invalid: '
+ r'\(unknown\): offset=(?P<move_offset>0x[0-9a-f]+) '
+ 'lies outside memory image; move discarded')
+ relocation_error = (r'relocation R_(386|AMD64|X86_64|SPARC)_\w+ '
+ r'sizes differ: (?P<reloc_symbol>.*)'
+ r'|\t\t\(file .* size=0(?:x[0-9a-f]+)?; file .*'
+ r'size=0x(?:[0-9a-f]+)?\)'
+ r'|\t.* size used; possible data truncation')
+ blank_line = (r'^\s*$')
+ common_re = (r"(%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s)"
% (found_re, symbol_not_found_re, only_so, version_so,
- stv_protected, sizes_differ, sizes_info, sizes_one_used))
+ stv_protected, sizes_differ, sizes_info,
+ sizes_one_used, unreferenced_object, unused_object,
+ unused_search_path, blank_line, move_offset_error,
+ relocation_error))
m = re.match(common_re, line)
- response = {}
+ response = None
if m:
+ response = {}
d = m.groupdict()
if "soname" in d and d["soname"]:
# it was found
@@ -305,6 +582,11 @@
response["soname"] = None
response["path"] = d["path_not_found"]
response["symbol"] = d["symbol"]
+ elif "binary" in d and d["binary"] and binary == d["binary"]:
+ response["state"] = "soname-unused"
+ response["soname"] = os.path.basename(d["object"])
+ response["path"] = None
+ response["symbol"] = None
elif d["path_only"]:
response["state"] = "OK"
response["soname"] = None
@@ -316,7 +598,8 @@
response["path"] = None
response["symbol"] = None
elif d["relocation_symbol"]:
- response["state"] = 'relocation-bound-to-a-symbol-with-STV_PROTECTED-visibility'
+ response["state"] = ("relocation-bound-to-a-symbol"
+ "-with-STV_PROTECTED-visibility")
response["soname"] = None
response["path"] = d["relocation_path"]
response["symbol"] = d["relocation_symbol"]
@@ -335,12 +618,23 @@
response["soname"] = None
response["path"] = "%s" % (d["sizediffused_file"])
response["symbol"] = None
- else:
- raise StdoutSyntaxError("Could not parse %s with %s"
- % (repr(line), common_re))
+ elif d["move_offset"]:
+ response["state"] = 'move-offset-error'
+ response["soname"] = None
+ response["path"] = None
+ response["symbol"] = None
+ response["move_offset"] = d['move_offset']
+ response["move_index"] = d['move_index']
+ elif d["reloc_symbol"]:
+ response["state"] = 'relocation-issue'
+ response["soname"] = None
+ response["path"] = None
+ response["symbol"] = d['reloc_symbol']
+
else:
- raise StdoutSyntaxError("Could not parse %s with %s"
- % (repr(line), common_re))
+ raise package.StdoutSyntaxError("Could not parse %s with %s"
+ % (repr(line), common_re))
+
return response
def GetDependencies(self):
@@ -409,9 +703,9 @@
pkgname, catalogname = fields[0:2]
obsoleted_by.append((pkgname, catalogname))
- return { "syntax_ok": obsoleted_syntax_ok,
- "obsoleted_by": obsoleted_by,
- "has_obsolete_info": has_obsolete_info }
+ return {"syntax_ok": obsoleted_syntax_ok,
+ "obsoleted_by": obsoleted_by,
+ "has_obsolete_info": has_obsolete_info}
class FileMagic(object):
@@ -446,7 +740,7 @@
for i in xrange(10):
mime = self.magic_cookie.file(full_path)
if mime:
- break;
+ break
else:
# Returned mime is null. Re-initializing the cookie and trying again.
logging.error("magic_cookie.file(%s) returned None. Retrying.",
@@ -466,6 +760,7 @@
# The presence of this method makes it explicit that we want an inspective
# version of the directory format package.
+
def GetInspectivePkg(self):
return self.GetDirFormatPkg()
Modified: csw/mgar/gar/v2/lib/python/inspective_package_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -6,6 +6,7 @@
import hachoir_parser
import magic
import os
+import common_constants
LDD_R_OUTPUT_1 = """\tlibc.so.1 => /lib/libc.so.1
\tsymbol not found: check_encoding_conversion_args (/opt/csw/lib/postgresql/8.4/utf8_and_gbk.so)
@@ -69,11 +70,136 @@
self.assertEqual([u'foo-file'], ip.ListBinaries())
+
+
+ def testGetBinaryElfInfo(self):
+
+ fake_binary = 'opt/csw/lib/libssl.so.1.0.0'
+ fake_package_path = '/fake/path/CSWfoo'
+ fake_elfdump_output = '''
+Version Definition Section: .SUNW_version
+ index version dependency
+ [1] libssl.so.1.0.0 [ BASE ]
+ [2] OPENSSL_1.0.0
+ [3] OPENSSL_1.0.1 OPENSSL_1.0.0
+
+Version Needed Section: .SUNW_version
+ index file version
+ [4] libcrypto.so.1.0.0 OPENSSL_1.0.0 [ INFO ]
+ [5] OPENSSL_1.0.1
+ [6] libnsl.so.1 SUNW_1.9.1
+
+Symbol Table Section: .dynsym
+ index value size type bind oth ver shndx name
+ [0] 0x00000000 0x00000000 NOTY LOCL D 0 UNDEF
+ [1] 0x00000000 0x00000000 FUNC GLOB D 4 UNDEF EVP_DigestSignFinal
+ [2] 0x0003ead4 0x000000dc FUNC GLOB P 2 .text SSL_get_shared_ciphers
+ [3] 0x0004f8f8 0x00000014 FUNC GLOB P 3 .text SSL_CTX_set_srp_client_pwd_callback
+ [4] 0x00000000 0x00000000 FUNC GLOB D 5 UNDEF SRP_Calc_client_key
+ [5] 0x000661a0 0x00000000 OBJT GLOB P 1 .got _GLOBAL_OFFSET_TABLE_
+
+Syminfo Section: .SUNW_syminfo
+ index flags bound to symbol
+ [1] DBL [1] libcrypto.so.1.0.0 EVP_DigestSignFinal
+ [2] DB <self> SSL_get_shared_ciphers
+ [3] DB <self> SSL_CTX_set_srp_client_pwd_callback
+ [4] DBL [1] libcrypto.so.1.0.0 SRP_Calc_client_key
+ [5] DB <self> _GLOBAL_OFFSET_TABLE_
+'''
+ fake_binary_elfinfo = {'opt/csw/lib/libssl.so.1.0.0': {
+ 'symbol table': [
+ {'shndx': 'UNDEF', 'soname': None, 'bind': 'LOCL',
+ 'symbol': None, 'version': None, 'flags': None, 'type': 'NOTY'},
+ {'shndx': 'UNDEF', 'soname': 'libcrypto.so.1.0.0', 'bind': 'GLOB',
+ 'symbol': 'EVP_DigestSignFinal', 'version': 'OPENSSL_1.0.0',
+ 'flags': 'DBL', 'type': 'FUNC'},
+ {'shndx': 'UNDEF', 'soname': 'libcrypto.so.1.0.0', 'bind': 'GLOB',
+ 'symbol': 'SRP_Calc_client_key', 'version': 'OPENSSL_1.0.1',
+ 'flags': 'DBL', 'type': 'FUNC'},
+ {'shndx': '.text', 'soname': None, 'bind': 'GLOB',
+ 'symbol': 'SSL_CTX_set_srp_client_pwd_callback',
+ 'version': 'OPENSSL_1.0.1', 'flags': 'DB', 'type': 'FUNC'},
+ {'shndx': '.text', 'soname': None, 'bind': 'GLOB',
+ 'symbol': 'SSL_get_shared_ciphers', 'version': 'OPENSSL_1.0.0',
+ 'flags': 'DB', 'type': 'FUNC'},
+ {'shndx': '.got', 'soname': None, 'bind': 'GLOB',
+ 'symbol': '_GLOBAL_OFFSET_TABLE_', 'version': None,
+ 'flags': 'DB', 'type': 'OBJT'},
+ ],
+ 'version definition': [
+ {'dependency': None, 'version': 'OPENSSL_1.0.0'},
+ {'dependency': 'OPENSSL_1.0.0', 'version': 'OPENSSL_1.0.1'},
+ ],
+ 'version needed': [
+ {'version': 'OPENSSL_1.0.0', 'soname': 'libcrypto.so.1.0.0'},
+ {'version': 'OPENSSL_1.0.1', 'soname': 'libcrypto.so.1.0.0'},
+ {'version': 'SUNW_1.9.1', 'soname': 'libnsl.so.1'},
+ ]
+ }
+ }
+
+ ip = inspective_package.InspectivePackage(fake_package_path)
+ self.mox.StubOutWithMock(ip, 'ListBinaries')
+ ip.ListBinaries().AndReturn([fake_binary])
+
+ self.mox.StubOutWithMock(inspective_package, 'ShellCommand')
+ args = [common_constants.ELFDUMP_BIN,
+ '-svy',
+ os.path.join(fake_package_path, "root", fake_binary)]
+ inspective_package.ShellCommand(args).AndReturn((0, fake_elfdump_output, ""))
+ self.mox.ReplayAll()
+
+ self.assertEqual(fake_binary_elfinfo, ip.GetBinaryElfInfo())
+
+
+
class PackageStatsUnitTest(unittest.TestCase):
def setUp(self):
self.ip = inspective_package.InspectivePackage("/fake/path/CSWfoo")
+ def test_ParseElfdumpLineSectionHeader(self):
+ line = 'Symbol Table Section: .dynsym'
+ self.assertEqual((None, "symbol table"), self.ip._ParseElfdumpLine(line, None))
+
+ def test_ParseElfdumpLineVersionNeeded(self):
+ line = '[13] SUNW_0.9 [ INFO ]'
+ expected = {
+ 'index': '13',
+ 'version': 'SUNW_0.9',
+ 'soname': None
+ }
+ self.assertEqual((expected, "version needed"), self.ip._ParseElfdumpLine(line, 'version needed'))
+
+ def test_ParseElfdumpLineSymbolTable(self):
+ line = ' [9] 0x000224b8 0x0000001c FUNC GLOB D 1 .text vsf_log_line'
+ expected = {
+ 'bind': 'GLOB',
+ 'shndx': '.text',
+ 'symbol': 'vsf_log_line',
+ 'version': '1',
+ 'type': 'FUNC',
+ }
+ self.assertEqual((expected, 'symbol table'), self.ip._ParseElfdumpLine(line, 'symbol table'))
+
+ def test_ParseElfdumpLineNeededSymbol(self):
+ line = ' [152] DB [4] libc.so.1 strlen'
+ expected = {
+ 'flags': 'DB',
+ 'soname': 'libc.so.1',
+ 'symbol': 'strlen',
+ }
+ self.assertEqual((expected, "syminfo"), self.ip._ParseElfdumpLine(line, "syminfo"))
+
+ def test_ParseElfdumpLineExportedSymbol(self):
+ line = ' [116] DB <self> environ'
+ expected = {
+ 'flags': 'DB',
+ 'soname': None,
+ 'symbol': 'environ',
+ }
+ self.assertEqual((expected, "syminfo"), self.ip._ParseElfdumpLine(line, "syminfo"))
+
def test_ParseNmSymLineGoodLine(self):
line = '0000097616 T aliases_lookup'
expected = {
Modified: csw/mgar/gar/v2/lib/python/package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/package.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -42,6 +42,8 @@
class PackageError(Error):
pass
+class StdoutSyntaxError(Error):
+ pass
class CswSrv4File(shell.ShellMixin, object):
"""Represents a package in the srv4 format (pkg)."""
@@ -277,7 +279,7 @@
basedir = pkginfo[basedir_id]
else:
basedir = ""
- # The convention in checkpkg is to not include the leading slash in paths.
+ # The convention in checkpkg is to not include the leading slash in paths.
basedir = basedir.lstrip("/")
return basedir
Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -25,6 +25,8 @@
from testdata.neon_stats import pkgstats as neon_stats
from testdata.bdb48_stats import pkgstat_objs as bdb48_stats
from testdata.mercurial_stats import pkgstat_objs as mercurial_stats
+from testdata.cadaver_stats import pkgstats as cadaver_stats
+from testdata.vsftpd_stats import pkgstats as vsftpd_stats
from testdata import stubs
DEFAULT_PKG_STATS = None
@@ -498,6 +500,13 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWfoo", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libdb-4.7.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/lib': [u'CSWfoo'],
u'/opt/csw/lib/sparcv9': [u'CSWfoo'],
@@ -526,6 +535,13 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWbad", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libdb-4.7.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/bdb47/lib': [u'CSWbad'],
u'/opt/csw/bdb47lib/sparcv9': [u'CSWbad'],
@@ -554,6 +570,15 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWbad", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [{ 'symbol': 'foo',
+ 'soname': 'libdb-4.7.so',
+ 'bind': 'GLOB',
+ 'shndx': 'UNDEF',
+ 'flags': 'DBL' }],
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/bdb47/lib': [u'CSWbad'],
u'/opt/csw/bdb47lib/sparcv9': [u'CSWbad'],
@@ -591,6 +616,15 @@
binaries_dump_info[0]["needed sonames"] = ["libm.so.2"]
self.pkg_data["depends"] = ((u"CSWcommon", ""),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/bin/sparcv8/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libm.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libm.so.2').AndReturn({
})
self.error_mgr_mock.GetPkgByPath(
@@ -634,6 +668,15 @@
}],
'depends': (('CSWlibfoo', None),),
'isalist': (),
+ 'ldd_info': { 'opt/csw/bin/bar': [] },
+ 'binaries_elf_info': { 'opt/csw/bin/bar': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libfoo.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'pkgmap': [],
'files_metadata': [
{'endian': 'Little endian',
@@ -650,6 +693,7 @@
'binaries_dump_info': [],
'depends': [],
'isalist': (),
+ 'ldd_info': {},
'pkgmap': [],
}
@@ -687,6 +731,20 @@
# 'depends': (),
'depends': ((u"CSWcommon", ""),),
'isalist': ('foo'),
+ 'ldd_info': { 'opt/csw/bin/bar': [], 'opt/csw/lib/libfoo.so.1': []},
+ 'binaries_elf_info': { 'opt/csw/bin/bar': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libfoo.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ },
+ 'opt/csw/lib/libfoo.so.1': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ }
+ },
'pkgmap': [
{ 'path': '/opt/csw/lib/libfoo.so.1', },
{ 'path': '/opt/csw/bin/bar', },
@@ -712,6 +770,16 @@
binaries_dump_info[0]["path"] = 'opt/csw/lib/python/site-packages/foo.so'
self.pkg_data["depends"] = ((u"CSWcommon", "This one provides directories"),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["ldd_info"] = { 'opt/csw/lib/python/site-packages/foo.so': [] }
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/lib/python/site-packages/foo.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libbar.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libbar.so').AndReturn({
u'/opt/csw/lib': [u'CSWlibbar'],
u'/opt/csw/lib/sparcv9': [u'CSWlibbar'],
@@ -738,6 +806,16 @@
binaries_dump_info[0]["path"] = 'opt/csw/lib/foo.so'
self.pkg_data["depends"] = ((u"CSWcommon","This is needed"),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["ldd_info"] = { 'opt/csw/lib/foo.so': [] }
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/lib/foo.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libnotfound.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename(
'libnotfound.so').AndReturn({})
self.error_mgr_mock.GetPkgByPath(
@@ -1333,7 +1411,174 @@
self.error_mgr_mock.NeedFile(
mox.IsA(str), mox.IsA(unicode), mox.IsA(str))
+class TestCheckUnusedSoname(CheckTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'SetCheckLibraries'
+ def testUnusedSoname(self):
+ self.pkg_data = cadaver_stats
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcurses.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libexpat.so.1').AndReturn({
+ "/opt/csw/lib": [u'CSWexpat'], u'/opt/csw/lib/sparcv9': [u'CSWexpat']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libiconv.so.2').AndReturn({
+ "/opt/csw/lib": [u'CSWlibiconv2'], u'/opt/csw/lib/sparcv9': [u'CSWlibiconv2']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libintl.so.8').AndReturn({
+ "/opt/csw/lib": (u"CSWggettextrt",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libm.so.2').AndReturn(
+ {'/lib': [u'SUNWlibmsr'],
+ '/lib/sparcv9': [u'SUNWlibmsr'],
+ '/usr/lib': [u'SUNWlibms'],
+ '/usr/lib/sparcv9': [u'SUNWlibms']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libmd.so.1').AndReturn(
+ {'/lib': [u'SUNWclsr'],
+ '/lib/sparcv9': [u'SUNWclsr'],
+ '/usr/lib': [u'SUNWcls'],
+ '/usr/lib/sparcv9': [u'SUNWcls']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libmp.so.2').AndReturn(
+ {'/lib': [u'SUNWclsr'],
+ '/lib/sparcv9': [u'SUNWclsr'],
+ '/usr/lib': [u'SUNWcls'],
+ '/usr/lib/sparcv9': [u'SUNWcls']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libncurses.so.5').AndReturn({
+ "/opt/csw/lib": [u'CSWlibncurses5'], u'/opt/csw/lib/sparcv9': [u'CSWlibncurses5']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libneon.so.27').AndReturn({
+ "/opt/csw/lib": [u'CSWlibneon27'], u'/opt/csw/lib/sparcv9': [u'CSWlibneon27']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libreadline.so.6').AndReturn({
+ "/opt/csw/lib": [u'CSWlibreadline6'], u'/opt/csw/lib/sparcv9': [u'CSWlibreadline6']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libz.so.1').AndReturn({
+ "/opt/csw/lib": (u"CSWlibz1",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibz1",),
+ "/usr/lib": (u"SUNWzlib")})
+
+
+ for common_path in ["/opt/csw/share/locale/it/LC_MESSAGES", "/opt/csw/bin",
+ "/opt/csw/share/locale/en at quot/LC_MESSAGES", "/opt/csw/share/man",
+ "/opt/csw/share/doc", "/opt/csw/share/locale/es/LC_MESSAGES"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for i in range(21):
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ for soname in [ 'libcurses.so.1', 'libz.so.1', 'libssl.so.1.0.0',
+ 'libcrypto.so.1.0.0', 'libexpat.so.1' ]:
+ self.error_mgr_mock.ReportError(
+ 'CSWcadaver', 'soname-unused',
+ soname + ' is needed by /opt/csw/bin/cadaver but never used')
+
+class TestCheckDirectBinding(CheckTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'SetCheckLibraries'
+ def testDirectBinding(self):
+ self.pkg_data = vsftpd_stats
+
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libpam.so.1').AndReturn({
+ "/usr/dt/lib": (u"SUNWdtbas",),
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),
+ })
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('librt.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsendfile.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+
+ for common_path in ["/opt/csw/share/man", "/var/opt/csw", "/opt/csw/sbin",
+ "/opt/csw/share/doc", "/etc/opt/csw"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for soname in [ 'libnsl.so.1', 'libpam.so.1', 'libsocket.so.1', 'librt.so.1',
+ 'libsendfile.so.1', 'libssl.so.1.0.0', 'libcrypto.so.1.0.0',
+ 'libc.so.1' ]:
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ self.error_mgr_mock.ReportError(
+ 'CSWvsftpd',
+ 'no-direct-binding',
+ '/opt/csw/sbin/vsftpd is not directly bound to soname ' + soname)
+
+ def testDirectBindingNoSyminfo(self):
+ self.pkg_data = vsftpd_stats
+ self.pkg_data[0]['binaries_elf_info']['opt/csw/sbin/vsftpd'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] }
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libpam.so.1').AndReturn({
+ "/usr/dt/lib": (u"SUNWdtbas",),
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),
+ })
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('librt.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsendfile.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+
+ for common_path in ["/opt/csw/share/man", "/var/opt/csw", "/opt/csw/sbin",
+ "/opt/csw/share/doc", "/etc/opt/csw"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for soname in [ 'libnsl.so.1', 'libpam.so.1', 'libsocket.so.1', 'librt.so.1',
+ 'libsendfile.so.1', 'libssl.so.1.0.0', 'libcrypto.so.1.0.0',
+ 'libc.so.1' ]:
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ for soname in [ 'libpam.so.1', 'libnsl.so.1', 'libcrypto.so.1.0.0',
+ 'librt.so.1', 'libsendfile.so.1', 'libssl.so.1.0.0',
+ 'libsocket.so.1', 'libc.so.1' ]:
+ self.error_mgr_mock.ReportError(
+ 'CSWvsftpd',
+ 'no-direct-binding',
+ '/opt/csw/sbin/vsftpd is not directly bound to soname ' + soname)
+
+
class TestCheckWrongArchitecture(CheckTestHelper, unittest.TestCase):
FUNCTION_NAME = 'CheckWrongArchitecture'
def testSparcBinariesInIntelPackage(self):
Modified: csw/mgar/gar/v2/lib/python/package_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/package_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -208,6 +208,8 @@
"basic_stats": basic_stats,
"files_metadata": dir_pkg.GetFilesMetadata(),
"mtime": self.GetMtime(),
+ "ldd_info": dir_pkg.GetLddMinusRlines(),
+ "binaries_elf_info": dir_pkg.GetBinaryElfInfo(),
}
self.SaveStats(pkg_stats)
logging.debug("Statistics of %s have been collected.", repr(dir_pkg.pkgname))
@@ -379,7 +381,12 @@
line_u = pkgmap_entry["line"].decode("latin1")
f_path, basename = os.path.split(
pkgmap_entry["path"].decode('latin1'))
+ except UnicodeEncodeError, e:
+ # the line was already in unicode
+ line_u = pkgmap_entry['line']
+ f_path, basename = os.path.split(pkgmap_entry["path"])
# If this fails too, code change will be needed.
+
f = m.CswFile(
basename=basename,
path=f_path,
Modified: csw/mgar/gar/v2/lib/python/package_stats_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats_test.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/package_stats_test.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -60,6 +60,8 @@
mock_dirpkg.GetFilesContaining(mox.IsA(tuple)).AndReturn([])
mock_dirpkg.GetFilesMetadata().AndReturn([])
mock_srv4.GetMtime().AndReturn(datetime.datetime(2010, 12, 8, 7, 52, 54))
+ mock_dirpkg.GetLddMinusRlines().AndReturn({})
+ mock_dirpkg.GetBinaryElfInfo().AndReturn({})
pkgstats = package_stats.PackageStats(mock_srv4)
self.mox.ReplayAll()
data_structure = pkgstats._CollectStats(True)
Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -84,7 +84,7 @@
"bratislava",
])
CATALOGS_ALLOWED_TO_BE_IMPORTED = frozenset([
- "current",
+ "unstable",
])
Modified: csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -207,6 +207,40 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_dbd_sqlite3-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_dbm_db-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_ldap-1.so': [],
+ 'opt/csw/lib/libaprutil-1.so.0.3.9': []},
+ 'binaries_elf_info': {'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_dbd_sqlite3-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_dbm_db-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_ldap-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/libaprutil-1.so.0.3.9': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ },
+ 'binaries_dump_info': [{'RPATH set': True,
+ 'RUNPATH RPATH the same': True,
+ 'RUNPATH set': True,
+ 'base_name': 'apr_dbd_odbc-1.so',
+ 'needed sonames': ('libodbc.so.1', 'libc.so.1'),
+ 'path': 'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so',
+ 'runpath': ('/opt/csw/bdb47/lib', '/opt/csw/lib'),
+ 'soname': 'apr_dbd_odbc-1.so'},
'mtime': datetime.datetime(2010, 8, 27, 11, 0, 10),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -745,6 +745,68 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/bdb48/bin/db_archive': [],
+ 'opt/csw/bdb48/bin/db_checkpoint': [],
+ 'opt/csw/bdb48/bin/db_deadlock': [],
+ 'opt/csw/bdb48/bin/db_dump': [],
+ 'opt/csw/bdb48/bin/db_hotbackup': [],
+ 'opt/csw/bdb48/bin/db_load': [],
+ 'opt/csw/bdb48/bin/db_printlog': [],
+ 'opt/csw/bdb48/bin/db_recover': [],
+ 'opt/csw/bdb48/bin/db_sql': [],
+ 'opt/csw/bdb48/bin/db_stat': [],
+ 'opt/csw/bdb48/bin/db_upgrade': [],
+ 'opt/csw/bdb48/bin/db_verify': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_archive': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_checkpoint': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_deadlock': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_dump': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_hotbackup': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_load': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_printlog': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_recover': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_sql': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_stat': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_upgrade': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_verify': [],
+ 'opt/csw/bdb48/lib/libdb-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_cxx-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_java-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_tcl-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb_cxx-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb_java-4.8.so': []},
+ 'ldd_info': {'opt/csw/bdb48/bin/db_archive': {},
+ 'opt/csw/bdb48/bin/db_checkpoint': {},
+ 'opt/csw/bdb48/bin/db_deadlock': {},
+ 'opt/csw/bdb48/bin/db_dump': {},
+ 'opt/csw/bdb48/bin/db_hotbackup': {},
+ 'opt/csw/bdb48/bin/db_load': {},
+ 'opt/csw/bdb48/bin/db_printlog': {},
+ 'opt/csw/bdb48/bin/db_recover': {},
+ 'opt/csw/bdb48/bin/db_sql': {},
+ 'opt/csw/bdb48/bin/db_stat': {},
+ 'opt/csw/bdb48/bin/db_upgrade': {},
+ 'opt/csw/bdb48/bin/db_verify': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_archive': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_checkpoint': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_deadlock': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_dump': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_hotbackup': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_load': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_printlog': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_recover': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_sql': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_stat': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_upgrade': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_verify': {},
+ 'opt/csw/bdb48/lib/libdb-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_cxx-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_java-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_tcl-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb_cxx-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb_java-4.8.so': {}},
'mtime': datetime.datetime(2010, 3, 2, 18, 9, 30),
'overrides': [],
'pkgchk': {'return_code': 0,
Copied: csw/mgar/gar/v2/lib/python/testdata/cadaver_stats.py (from rev 20023, csw/mgar/gar/v2-yann/lib/python/testdata/cadaver_stats.py)
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/cadaver_stats.py (rev 0)
+++ csw/mgar/gar/v2/lib/python/testdata/cadaver_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -0,0 +1,208 @@
+import datetime
+pkgstats = [{'bad_paths': {},
+ 'basic_stats': {'catalogname': 'cadaver',
+ 'md5_sum': 'd74a2f65ef0caff0bdde7310007764a8',
+ 'parsed_basename': {'arch': 'i386',
+ 'catalogname': 'cadaver',
+ 'full_version_string': '0.23.3,REV=2012.06.06',
+ 'osrel': 'SunOS5.10',
+ 'revision_info': {'REV': '2012.06.06'},
+ 'vendortag': 'CSW',
+ 'version': '0.23.3',
+ 'version_info': {'major version': '0',
+ 'minor version': '23',
+ 'patchlevel': '3'}},
+ 'pkg_basename': 'neon-0.29.0,REV=2009.09.14-SunOS5.8-i386-CSW.pkg.gz',
+ 'pkg_path': '/tmp/pkg_3Wy60k/cadaver-0.23.3,REV=2012.06.06-i386-CSW.pkg.gz',
+ 'pkgname': 'CSWcadaver',
+ 'size': 215040L,
+ 'stats_version': 10L},
+ 'binaries': ['opt/csw/bin/cadaver'],
+ 'binaries_dump_info': [{'RPATH set': True,
+ 'RUNPATH RPATH the same': True,
+ 'RUNPATH set': True,
+ 'base_name': 'cadaver',
+ 'needed sonames': ('libreadline.so.6',
+ 'libcurses.so.1',
+ 'libintl.so.8',
+ 'libneon.so.27',
+ 'libnsl.so.1',
+ 'libsocket.so.1',
+ 'libz.so.1',
+ 'libssl.so.1.0.0',
+ 'libcrypto.so.1.0.0',
+ 'libdl.so.1',
+ 'libexpat.so.1',
+ 'libc.so.1',
+ 'libncurses.so.5',
+ 'libiconv.so.2',
+ 'libmp.so.2',
+ 'libmd.so.1',
+ 'libm.so.2'),
+ 'path': 'opt/csw/bin/cadaver',
+ 'runpath': ('/opt/csw/lib/$ISALIST',
+ '/opt/csw/lib',
+ '/opt/csw/lib',
+ '/opt/csw/lib/'),
+ 'soname': None}],
+ 'depends': [('CSWcommon',
+ 'CSWcommon common - common files and dirs for CSW packages'),
+ ('CSWlibssl1-0-0',
+ 'libssl1_0_0 - Openssl 1.0 runtime libraries'),
+ ('CSWlibintl8',
+ 'libintl8 - GNU locale utilities, libintl.so.8'),
+ ('CSWlibneon27',
+ 'libneon27 - Neon HTTP and WebDAV client library, libneon.so.27'),
+ ('CSWlibreadline6',
+ 'libreadline6 - GNU readline library, libreadline.so.6'),
+ ('CSWlibexpat1',
+ 'libexpat1 - XML parser toolkit, libexpat.so.1'),
+ ('CSWlibz1',
+ 'libz1 - Zlib data compression library, libz.so.1')],
+ 'isalist': frozenset(['amd64',
+ 'i386',
+ 'i486',
+ 'i86',
+ 'pentium',
+ 'pentium+mmx',
+ 'pentium_pro',
+ 'pentium_pro+mmx']),
+ 'ldd_info': {'opt/csw/bin/cadaver': [ { 'soname': 'libcurses.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libnsl.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libsocket.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libz.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libssl.so.1.0.0', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libcrypto.so.1.0.0', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libdl.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None },
+ { 'soname': 'libexpat.so.1', 'state': 'soname-unused', 'path': None, 'symbol': None } ]},
+ 'binaries_elf_info': {'opt/csw/bin/cadaver': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libcurses.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libz.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libssl.so.1.0.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libcrypto.so.1.0.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libdl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libreadline.so.6', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libneon.so.27', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libncurses.so.5', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libmp.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libmd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libexpat.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]}},
+ 'mtime': datetime.datetime(2012, 6, 6, 20, 21, 14),
+ 'overrides': [],
+ 'pkgmap': [{'class': None,
+ 'group': None,
+ 'line': ': 1 458',
+ 'mode': None,
+ 'path': None,
+ 'target': None,
+ 'type': '1',
+ 'user': None},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/bin/cadaver',
+ 'mode': '0755',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/bin/cadaver 0755 root bin 127432 5422 1339017365'},
+ {'type': 'd',
+ 'class': None,
+ 'path': '/opt/csw/share/doc/cadaver',
+ 'mode': '0755',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 d none /opt/csw/share/doc/cadaver 0755 root bin'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/doc/cadaver/changelog.CSW',
+ 'mode': '0755',
+ 'user': 'root',
+ 'group': 'bin 1791 7810 1339017366',
+ 'line': '1 f none /opt/csw/share/doc/cadaver/changelog.CSW 0755 root bin 1791 7810 1339017366'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/doc/cadaver/license',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/doc/cadaver/license 0644 root bin 17982 28433 1339017365'},
+ {'type': 'd',
+ 'class': None,
+ 'path': '/opt/csw/share/doc/cadaver_stub',
+ 'mode': '0755',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 d none /opt/csw/share/doc/cadaver_stub 0755 root bin'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/doc/cadaver_stub/changelog.CSW',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/doc/cadaver_stub/changelog.CSW 0644 root bin 1791 7810 1339017366'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/locale/en at quot/LC_MESSAGES/cadaver.mo',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/locale/en at quot/LC_MESSAGES/cadaver.mo 0644 root bin 32658 7633 1339017365'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/locale/es/LC_MESSAGES/cadaver.mo',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/locale/es/LC_MESSAGES/cadaver.mo 0644 root bin 13554 44368 1339017365'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/locale/it/LC_MESSAGES/cadaver.mo',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/locale/it/LC_MESSAGES/cadaver.mo 0644 root bin 13689 56410 1339017365'},
+ {'type': 'd',
+ 'class': None,
+ 'path': '/opt/csw/share/man/man1',
+ 'mode': '0755',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 d none /opt/csw/share/man/man1 0755 root bin'},
+ {'type': 'f',
+ 'class': None,
+ 'path': '/opt/csw/share/man/man1/cadaver.1',
+ 'mode': '0644',
+ 'user': 'root',
+ 'group': 'bin',
+ 'line': '1 f none /opt/csw/share/man/man1/cadaver.1 0644 root bin 4586 7373 1339017365'},
+ {'type': 'i',
+ 'class': None,
+ 'path': None,
+ 'mode': None,
+ 'user': None,
+ 'group': None,
+ 'line': '1 i copyright 71 6651 1339017365'},
+ {'type': 'i',
+ 'class': None,
+ 'path': None,
+ 'mode': None,
+ 'user': None,
+ 'group': None,
+ 'line': '1 i depend 452 39068 1339017371'},
+ {'type': 'i',
+ 'class': None,
+ 'path': None,
+ 'mode': None,
+ 'user': None,
+ 'group': None,
+ 'line': '1 i pkginfo 552 45244 1339017374'}],
+}]
Modified: csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -111,6 +111,47 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/libdjvulibre.so.15': [],
+ 'opt/csw/lib/sparcv9/libdjvulibre.so.21.1.0': [],
+ 'opt/csw/lib/libdjvulibre.so.21.1.0': [] },
+ 'binaries_elf_info': {'opt/csw/lib/libdjvulibre.so.15': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.62', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ 'opt/csw/lib/sparcv9/libdjvulibre.so.21.1.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.7', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ 'opt/csw/lib/libdjvulibre.so.21.1.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.7', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ },
'overrides': [],
'pkginfo': {'ARCH': 'sparc',
'CATEGORY': 'application',
Modified: csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -56,6 +56,21 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/bin/comdraw': [],
+ 'opt/csw/lib/libComUnidraw.so.1.1.3': []},
+ 'binaries_elf_info': {'opt/csw/bin/comdraw': {
+ 'version definition': [],
+ 'version needed' : [],
+ 'symbol table': [
+ { 'soname': 'libComUnidraw.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' } ,
+ ],
+ },
+ 'opt/csw/lib/libComUnidraw.so.1.1.3': {
+ 'version definition': [],
+ 'version needed' : [],
+ 'symbol table': []
+ }
+ },
'overrides': [],
'pkgchk': {'return_code': 0,
'stderr_lines': ['rm: Cannot remove any directory in the path of the current working directory',
Modified: csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -86,6 +86,39 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/svn/libsvnjavahl-1.so.0.0.0': []},
+ 'binaries_elf_info': { 'opt/csw/lib/svn/libsvnjavahl-1.so.0.0.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_repos-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_client-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_wc-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_ra-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_delta-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_diff-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_subr-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_fs-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libaprutil-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libldap-2.4.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'liblber-2.4.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libexpat.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libapr-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libuuid.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsendfile.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'librt.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libdl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libneon.so.27', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]}
+ },
'mtime': datetime.datetime(2010, 7, 12, 19, 6, 15),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -31,6 +31,8 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {},
+ 'binaries_elf_info': {},
'mtime': datetime.datetime(2008, 8, 20, 10, 26, 15),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -703,6 +703,37 @@
'sparcv9',
'sparcv9+vis',
'sparcv9+vis2']),
+ 'ldd_info': { 'opt/csw/lib/python/site-packages/mercurial/base85.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/bdiff.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/diffhelpers.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/mpatch.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/osutil.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/parsers.so': [],},
+ 'binaries_elf_info': { 'opt/csw/lib/python/site-packages/mercurial/base85.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/bdiff.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/diffhelpers.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/mpatch.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/osutil.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/parsers.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ },
'mtime': datetime.datetime(2011, 2, 15, 7, 46, 49),
'overrides': [{'pkgname': 'CSWmercurial',
'tag_info': None,
Modified: csw/mgar/gar/v2/lib/python/testdata/neon_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/neon_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/neon_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -163,6 +163,27 @@
'pentium+mmx',
'pentium_pro',
'pentium_pro+mmx']),
+ 'ldd_info': {'opt/csw/lib/libneon.so.26.0.4': [],
+ 'opt/csw/lib/libneon.so.27.2.0': [],
+ 'opt/csw/lib/sparcv9/libneon.so.26.0.4': [],
+ 'opt/csw/lib/sparcv9/libneon.so.27.2.0': []},
+ 'binaries_elf_info': { 'opt/csw/lib/libneon.so.26.0.4': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/libneon.so.27.2.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/sparcv9/libneon.so.26.0.4': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/sparcv9/libneon.so.27.2.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ },
'mtime': datetime.datetime(2009, 9, 23, 20, 21, 14),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -74,17 +74,45 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': { 'opt/csw/bin/sparcv8/rsync': [],
+ 'opt/csw/bin/sparcv9/rsync': [] },
+ 'binaries_elf_info': {
+ 'opt/csw/bin/sparcv8/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libpopt.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsec.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ },
+ 'opt/csw/bin/sparcv9/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libpopt.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsec.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'overrides': [],
'pkgchk': {'return_code': 0,
- 'stderr_lines': ['rm: Cannot remove any directory in the path of the current working directory',
- '/var/tmp/aaacuaqYV/CSWrsync'],
- 'stdout_lines': ['Checking uninstalled stream format package <CSWrsync> from </tmp/pkg_wq7Wyx/rsync-3.0.7,REV=2010.02.17-SunOS5.8-sparc-CSW.pkg>',
- '## Checking control scripts.',
- '## Checking package objects.',
- '## Checking is complete.']},
+ 'stderr_lines': ['rm: cannot remove any directory in the path of the current working directory',
+ '/var/tmp/aaacuaqyv/cswrsync'],
+ 'stdout_lines': ['checking uninstalled stream format package <cswrsync> from </tmp/pkg_wq7wyx/rsync-3.0.7,rev=2010.02.17-sunos5.8-sparc-csw.pkg>',
+ '## checking control scripts.',
+ '## checking package objects.',
+ '## checking is complete.']},
'pkginfo': {'ARCH': 'sparc',
'CATEGORY': 'application',
- 'CLASSES': 'none',
+ 'CLASSES': 'None',
'EMAIL': 'maciej at opencsw.org',
'HOTLINE': 'http://www.opencsw.org/bugtrack/',
'NAME': 'rsync - utility which provides fast incremental file transfer',
@@ -93,8 +121,8 @@
'OPENCSW_REPOSITORY': 'https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/rsync/trunk@8611',
'PKG': 'CSWrsync',
'PSTAMP': 'maciej at build8s-20100217094608',
- 'VENDOR': 'http://rsync.samba.org/ packaged for CSW by Maciej Blizinski',
- 'VERSION': '3.0.7,REV=2010.02.17',
+ 'VENDOR': 'http://rsync.samba.org/ packaged for csw by maciej blizinski',
+ 'VERSION': '3.0.7,rev=2010.02.17',
'WORKDIR_FIRSTMOD': '../build-isa-sparcv8'},
'pkgmap': [{'class': None,
'group': None,
@@ -103,65 +131,65 @@
'path': None,
'type': '1',
'user': None},
- {'class': 'none',
+ {'class': 'None',
'group': None,
- 'line': '1 l none /opt/csw/bin/rsync=/opt/csw/bin/isaexec',
+ 'line': '1 l None /opt/csw/bin/rsync=/opt/csw/bin/isaexec',
'mode': None,
'path': '/opt/csw/bin/rsync',
'type': 'l',
'user': None},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 f none /opt/csw/bin/sparcv8/rsync 0755 root bin 585864 12576 1266395028',
+ 'line': '1 f None /opt/csw/bin/sparcv8/rsync 0755 root bin 585864 12576 1266395028',
'mode': '0755',
'path': '/opt/csw/bin/sparcv8/rsync',
'type': 'f',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 f none /opt/csw/bin/sparcv9/rsync 0755 root bin 665520 60792 1266395239',
+ 'line': '1 f None /opt/csw/bin/sparcv9/rsync 0755 root bin 665520 60792 1266395239',
'mode': '0755',
'path': '/opt/csw/bin/sparcv9/rsync',
'type': 'f',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 d none /opt/csw/share/doc/rsync 0755 root bin',
+ 'line': '1 d None /opt/csw/share/doc/rsync 0755 root bin',
'mode': '0755',
'path': '/opt/csw/share/doc/rsync',
'type': 'd',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 f none /opt/csw/share/doc/rsync/license 0644 root bin 35147 30328 1266396366',
+ 'line': '1 f None /opt/csw/share/doc/rsync/license 0644 root bin 35147 30328 1266396366',
'mode': '0644',
'path': '/opt/csw/share/doc/rsync/license',
'type': 'f',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 d none /opt/csw/share/man/man1 0755 root bin',
+ 'line': '1 d None /opt/csw/share/man/man1 0755 root bin',
'mode': '0755',
'path': '/opt/csw/share/man/man1',
'type': 'd',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 f none /opt/csw/share/man/man1/rsync.1 0644 root bin 159739 65016 1266395027',
+ 'line': '1 f None /opt/csw/share/man/man1/rsync.1 0644 root bin 159739 65016 1266395027',
'mode': '0644',
'path': '/opt/csw/share/man/man1/rsync.1',
'type': 'f',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 d none /opt/csw/share/man/man5 0755 root bin',
+ 'line': '1 d None /opt/csw/share/man/man5 0755 root bin',
'mode': '0755',
'path': '/opt/csw/share/man/man5',
'type': 'd',
'user': 'root'},
- {'class': 'none',
+ {'class': 'None',
'group': 'bin',
- 'line': '1 f none /opt/csw/share/man/man5/rsyncd.conf.5 0644 root bin 36372 24688 1266395027',
+ 'line': '1 f None /opt/csw/share/man/man5/rsyncd.conf.5 0644 root bin 36372 24688 1266395027',
'mode': '0644',
'path': '/opt/csw/share/man/man5/rsyncd.conf.5',
'type': 'f',
Modified: csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py 2013-01-04 17:55:36 UTC (rev 20026)
+++ csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py 2013-01-04 19:40:05 UTC (rev 20027)
@@ -71,317 +71,349 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/libexec/sudo_noexec.so': [],
+ 'opt/csw/sbin/visudo': []},
+ 'binaries_elf_info': {'opt/csw/libexec/sudo_noexec.so': {
+ 'version needed': [],
+ 'version definition': [],
+ 'symbol table': [ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' } ],
+ },
+ 'opt/csw/sbin/visudo': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ }
+ },
'mtime': datetime.datetime(2010, 3, 2, 22, 34, 40),
'overrides': [],
'pkgchk': {'return_code': 0,
- 'stderr_lines': ['rm: Cannot remove any directory in the path of the current working directory',
- '/var/tmp/aaajqaOvt/CSWsudo-common'],
- 'stdout_lines': ['Checking uninstalled stream format package <CSWsudo-common> from </tmp/pkg_4nepTE/sudo_common-1.7.2p5,REV=2010.03.02-SunOS5.8-sparc-CSW.pkg>',
- '## Checking control scripts.',
- '## Checking package objects.',
- '## Checking is complete.']},
- 'pkginfo': {'ARCH': 'sparc',
- 'CATEGORY': 'application',
- 'CLASSES': 'none',
- 'EMAIL': 'maciej at opencsw.org',
- 'HOTLINE': 'http://www.opencsw.org/bugtrack/',
- 'NAME': 'sudo_common - Common files for sudo',
- 'OPENCSW_CATALOGNAME': 'sudo_common',
- 'OPENCSW_MODE64': '32',
- 'OPENCSW_REPOSITORY': 'https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/sudo/trunk@8935',
- 'PKG': 'CSWsudo-common',
- 'PSTAMP': 'maciej at build8s-20100302104744',
@@ Diff output truncated at 100000 characters. @@
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