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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sun Feb 21 13:25:35 CET 2010


Revision: 8716
          http://gar.svn.sourceforge.net/gar/?rev=8716&view=rev
Author:   wahwah
Date:     2010-02-21 12:25:35 +0000 (Sun, 21 Feb 2010)

Log Message:
-----------
mGAR v2: submitpkg, for packages foo_a and foo_b, return group name foo, not foo_.

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-02-21 12:18:05 UTC (rev 8715)
+++ csw/mgar/gar/v2/lib/python/opencsw.py	2010-02-21 12:25:35 UTC (rev 8716)
@@ -562,6 +562,9 @@
                                            catalogname_list.pop())
     if substring_set:
       current_substring = list(substring_set)[0]
+  # If it's something like foo_, make it foo.
+  while current_substring and not current_substring[-1].isalnum():
+    current_substring = current_substring[:-1]
   if len(current_substring) >= 2:
     return current_substring
   return "various packages"

Modified: csw/mgar/gar/v2/lib/python/opencsw_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-02-21 12:18:05 UTC (rev 8715)
+++ csw/mgar/gar/v2/lib/python/opencsw_test.py	2010-02-21 12:25:35 UTC (rev 8716)
@@ -261,6 +261,8 @@
         ("foo", ["foo"]),
         ("foo", ["foo", "libfoo"]),
         ("foo", ["foo", "libfoo", "foo_devel"]),
+        ("foo_ba", ["foo_bar", "foo_baz"]),
+        ("foo", ["foo_a", "foo_b"]),
         ("various packages", ["foo", "libfoo", "foo_devel", "bar"]),
     ]
     for expected_name, catalogname_list in data:


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