[csw-devel] SF.net SVN: gar:[11915] csw/mgar/gar/v2/lib/python
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Mon Dec 13 11:50:13 CET 2010
Revision: 11915
http://gar.svn.sourceforge.net/gar/?rev=11915&view=rev
Author: wahwah
Date: 2010-12-13 10:50:13 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
checkpkg: A bugfix for CheckObsoleteDeps
Dependencies are now represented as sequences, which have to be unpacked to
get package names.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/package_checks.py
csw/mgar/gar/v2/lib/python/package_checks_test.py
Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py 2010-12-13 10:49:33 UTC (rev 11914)
+++ csw/mgar/gar/v2/lib/python/package_checks.py 2010-12-13 10:50:13 UTC (rev 11915)
@@ -501,7 +501,7 @@
def CheckObsoleteDeps(pkg_data, error_mgr, logger, messenger):
"""Checks for obsolete dependencies."""
- deps = set(pkg_data["depends"])
+ deps = frozenset([x for x, y in pkg_data["depends"]])
obsolete_pkg_deps = deps.intersection(set(OBSOLETE_DEPS))
if obsolete_pkg_deps:
for obsolete_pkg in obsolete_pkg_deps:
Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-12-13 10:49:33 UTC (rev 11914)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py 2010-12-13 10:50:13 UTC (rev 11915)
@@ -1477,5 +1477,14 @@
})
+class TestCheckObsoleteDepsCups(CheckpkgUnitTestHelper, unittest.TestCase):
+ "A random file should not trigger the message; only license files."
+ FUNCTION_NAME = 'CheckObsoleteDeps'
+ def CheckpkgTest(self):
+ self.pkg_data = copy.deepcopy(neon_stats[0])
+ self.pkg_data["depends"].append(("CSWlibcups", None))
+ self.error_mgr_mock.ReportError('obsolete-dependency', 'CSWlibcups')
+
+
if __name__ == '__main__':
unittest.main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list