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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Nov 17 11:53:17 CET 2010


Revision: 11644
          http://gar.svn.sourceforge.net/gar/?rev=11644&view=rev
Author:   wahwah
Date:     2010-11-17 10:53:17 +0000 (Wed, 17 Nov 2010)

Log Message:
-----------
mGAR v2: known pkgname prefixes moved to the top of opencsw.py, removed obsolete comments.

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

Modified: csw/mgar/gar/v2/lib/python/opencsw.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw.py	2010-11-17 10:52:51 UTC (rev 11643)
+++ csw/mgar/gar/v2/lib/python/opencsw.py	2010-11-17 10:53:17 UTC (rev 11644)
@@ -38,6 +38,7 @@
 REVISION_ADDED = "revision number added"
 PKG_URL_TMPL = "http://www.opencsw.org/packages/%s"
 CATALOG_URL = "http://mirror.opencsw.org/opencsw/current/i386/5.10/catalog"
+KNOWN_PKGNAME_PREFIXES = ["SUNW", "FJSV", "CSW"]
 SUBMITPKG_TMPL = """From: $from
 To: $to
 #if $cc
@@ -435,10 +436,9 @@
   SUNWbashS --> sunw_bash_s
   SUNWPython --> sunw_python
 
-  Incomprehensible, but unit tested!
+  This function is incomprehensible, but unit tested!
   """
-  known_prefixes = ["SUNW", "FJSV", "CSW"]
-  for prefix in known_prefixes:
+  for prefix in KNOWN_PKGNAME_PREFIXES:
     if pkgname.startswith(prefix):
       unused, tmp_prefix, the_rest = pkgname.partition(prefix)
       pkgname = tmp_prefix + "_" + the_rest
@@ -467,12 +467,6 @@
   catalogname_list = copy.copy(catalogname_list)
   if len(catalogname_list) == 1:
     return catalogname_list[0]
-  #current_substring = catalogname_list.pop()
-  #while catalogname_list and current_substring:
-  #  substring_set = su.LongestCommonSubstring(current_substring,
-  #                                            catalogname_list.pop())
-  #  if substring_set:
-  #    current_substring = list(substring_set)[0]
   current_substring = su.CollectionLongestCommonSubstring(catalogname_list)
   # If it's something like foo_, make it foo.
   while current_substring and not current_substring[-1].isalnum():


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