[csw-devel] SF.net SVN: gar:[9350] csw/mgar/gar/v2/lib/python/checkpkg.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Wed Mar 24 14:31:54 CET 2010
Revision: 9350
http://gar.svn.sourceforge.net/gar/?rev=9350&view=rev
Author: wahwah
Date: 2010-03-24 13:31:54 +0000 (Wed, 24 Mar 2010)
Log Message:
-----------
mGAR v2: checkpkg, handle the special case of arch=all in commondirs-%s
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/checkpkg.py
Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py 2010-03-24 10:42:59 UTC (rev 9349)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py 2010-03-24 13:31:54 UTC (rev 9350)
@@ -716,12 +716,19 @@
def GetCommonPaths(self, arch):
"""Returns a list of paths for architecture, from gar/etc/commondirs*."""
- 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 = f.read().splitlines()
- f.close()
+ assert arch in ('i386', 'sparc', 'all'), "Wrong arch: %s" % repr(arch)
+ if arch == 'all':
+ archs = ('i386', 'sparc')
+ else:
+ 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()
return lines
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