[csw-devel] SF.net SVN: gar:[11373] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Oct 22 10:00:18 CEST 2010


Revision: 11373
          http://gar.svn.sourceforge.net/gar/?rev=11373&view=rev
Author:   wahwah
Date:     2010-10-22 08:00:18 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
mGAR v2: opencsw.py, a correction for multiple revision tags in package names.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/opencsw.py
    csw/mgar/gar/v2/lib/python/opencsw_test.py

Modified: csw/mgar/gar/v2/lib/python/opencsw.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw.py	2010-10-22 07:59:57 UTC (rev 11372)
+++ csw/mgar/gar/v2/lib/python/opencsw.py	2010-10-22 08:00:18 UTC (rev 11373)
@@ -125,8 +125,12 @@
   tmpl = "%(catalogname)s-%(new_version)s-%(osrel)s-%(arch)s-%(vendortag)s.pkg"
   version_string = parsed_filename["version"]
   revision_info = parsed_filename["revision_info"]
-  for key in sorted(revision_info.keys()):
-    version_string += ",%s=%s" % (key, revision_info[key])
+  if revision_info:
+    version_string += ","
+    rev_lst = []
+    for key in sorted(revision_info.keys()):
+      rev_lst.append("%s=%s" % (key, revision_info[key]))
+    version_string += "_".join(rev_lst)
   new_data = copy.copy(parsed_filename)
   new_data["new_version"] = version_string
   return tmpl % new_data

Modified: csw/mgar/gar/v2/lib/python/opencsw_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-10-22 07:59:57 UTC (rev 11372)
+++ csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-10-22 08:00:18 UTC (rev 11373)
@@ -172,11 +172,11 @@
                                     'patchlevel': '87'}}
 
   def testSimple(self):
-    file_name = 'mysql5client-5.0.87,REV=2010.02.28-SunOS5.8-i386-CSW.pkg.gz'
+    file_name = 'mysql5client-5.0.87,REV=2010.02.28-SunOS5.8-i386-CSW.pkg'
     self.assertEquals(file_name, opencsw.ComposePackageFileName(self.parsed))
 
   def testMoreRev(self):
-    file_name = 'mysql5client-5.0.87,REV=2010.02.28,foo=bar-SunOS5.8-i386-CSW.pkg.gz'
+    file_name = 'mysql5client-5.0.87,REV=2010.02.28_foo=bar-SunOS5.8-i386-CSW.pkg'
     self.parsed["revision_info"]["foo"] = "bar"
     self.assertEquals(file_name, opencsw.ComposePackageFileName(self.parsed))
 


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