[csw-devel] SF.net SVN: gar:[9935] csw/mgar/gar/v2/lib/python
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Thu May 20 13:06:54 CEST 2010
Revision: 9935
http://gar.svn.sourceforge.net/gar/?rev=9935&view=rev
Author: wahwah
Date: 2010-05-20 11:06:53 +0000 (Thu, 20 May 2010)
Log Message:
-----------
mGAR v2: No longer throw an error about libX11.so.4
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/checkpkg.py
csw/mgar/gar/v2/lib/python/package_checks.py
csw/mgar/gar/v2/lib/python/package_checks_test.py
Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py 2010-05-20 10:45:13 UTC (rev 9934)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py 2010-05-20 11:06:53 UTC (rev 9935)
@@ -715,11 +715,15 @@
It wraps access to the /var/sadm/install/contents cache.
"""
- def __init__(self, system_pkgmap=None):
+ def __init__(self, system_pkgmap=None, lines_dict=None):
self.system_pkgmap = system_pkgmap
if not self.system_pkgmap:
self.system_pkgmap = SystemPkgmap()
self.common_paths = {}
+ if lines_dict:
+ self.lines_dict = lines_dict
+ else:
+ self.lines_dict = {}
def GetPkgmapLineByBasename(self, basename):
"""Proxies calls to self.system_pkgmap."""
@@ -734,6 +738,16 @@
def GetInstalledPackages(self):
return self.system_pkgmap.GetInstalledPackages()
+ def _GetPathsForArch(self, arch):
+ if not arch in self.lines_dict:
+ file_name = os.path.join(
+ os.path.dirname(__file__), "..", "..", "etc", "commondirs-%s" % arch)
+ logging.debug("opening %s", file_name)
+ f = open(file_name, "r")
+ self.lines_dict[arch] = f.read().splitlines()
+ f.close()
+ return self.lines_dict[arch]
+
def GetCommonPaths(self, arch):
"""Returns a list of paths for architecture, from gar/etc/commondirs*."""
# TODO: If this was cached, it would save a significant amount of time.
@@ -744,12 +758,7 @@
archs = [arch]
lines = []
for arch in archs:
- file_name = os.path.join(
- os.path.dirname(__file__), "..", "..", "etc", "commondirs-%s" % arch)
- logging.debug("opening %s", file_name)
- f = open(file_name, "r")
- lines.extend(f.read().splitlines())
- f.close()
+ lines.extend(self._GetPathsForArch(arch))
return lines
Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py 2010-05-20 10:45:13 UTC (rev 9934)
+++ csw/mgar/gar/v2/lib/python/package_checks.py 2010-05-20 11:06:53 UTC (rev 9935)
@@ -48,7 +48,11 @@
MAX_PKGNAME_LENGTH = 20
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"])
+
+# At some point, it was used to prevent people from linking against
+# libX11.so.4, but due to issues with 3D acceleration.
+DO_NOT_LINK_AGAINST_THESE_SONAMES = set([])
+
DISCOURAGED_FILE_PATTERNS = (
r"\.py[co]$",
r"/lib\w+\.l?a$",
Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-05-20 10:45:13 UTC (rev 9934)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-05-20 11:06:53 UTC (rev 9935)
@@ -268,8 +268,9 @@
'soname': 'libImlib2.so.1',
'soname_guessed': False,
})
- self.error_mgr_mock.ReportError('linked-against-discouraged-library',
- 'libImlib2.so.1.4.2 libX11.so.4')
+ # This no longer should throw an error.
+ # self.error_mgr_mock.ReportError('linked-against-discouraged-library',
+ # 'libImlib2.so.1.4.2 libX11.so.4')
class TestSetCheckSharedLibraryConsistency2_1(CheckpkgUnitTestHelper, unittest.TestCase):
FUNCTION_NAME = 'SetCheckLibraries'
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