[csw-devel] SF.net SVN: gar:[7826] csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/ checkpkg-obsolete-deps.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Sat Jan 2 12:01:42 CET 2010
Revision: 7826
http://gar.svn.sourceforge.net/gar/?rev=7826&view=rev
Author: wahwah
Date: 2010-01-02 11:01:42 +0000 (Sat, 02 Jan 2010)
Log Message:
-----------
A test for obsolete packages: checkpkg-obsolete-deps.py
Added Paths:
-----------
csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/checkpkg-obsolete-deps.py
Added: csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/checkpkg-obsolete-deps.py
===================================================================
--- csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/checkpkg-obsolete-deps.py (rev 0)
+++ csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/checkpkg-obsolete-deps.py 2010-01-02 11:01:42 UTC (rev 7826)
@@ -0,0 +1,43 @@
+#!/opt/csw/bin/python2.6
+# $Id$
+
+import checkpkg
+import logging
+import os.path
+import sys
+
+OBSOLETE_DEPS = {
+ # "CSWfoo": {
+ # "reason": "Due to...",
+ # "url": "http://www.opencsw.org/bugtrack/view.php?id=..."
+ # },
+ "CSWpython-rt": {
+ "reason": "CSWpython-rt is deprecated.",
+ "url": "http://www.opencsw.org/bugtrack/view.php?id=4031"
+ },
+}
+
+def main():
+ options, args = checkpkg.GetOptions()
+ ok = True
+ for pkgname in args:
+ pkgpath = os.path.join(options.extractdir, pkgname)
+ checker = checkpkg.CheckpkgBase(options.extractdir, pkgname)
+ deps = set(checker.GetDependencies())
+ obsolete_pkg_deps = deps.intersection(set(OBSOLETE_DEPS))
+ if obsolete_pkg_deps:
+ ok = False
+ for pkg in obsolete_pkg_deps:
+ print ("ERROR: Package %s should not depend on %s."
+ % (checker.pkgname, pkg))
+ if "reason" in OBSOLETE_DEPS[pkg]:
+ print "Reason:", OBSOLETE_DEPS[pkg]["reason"]
+ if "url" in OBSOLETE_DEPS[pkg]:
+ print "URL:", OBSOLETE_DEPS[pkg]["url"]
+ if ok:
+ sys.exit(0)
+ else:
+ sys.exit(1)
+
+if __name__ == '__main__':
+ main()
Property changes on: csw/mgar/gar/v2-checkpkg/bin/checkpkg.d/checkpkg-obsolete-deps.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Id
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