Merged from trunk -r13184:13187
authorFabian Groffen <grobian@gentoo.org>
Thu, 26 Mar 2009 20:54:28 +0000 (20:54 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 26 Mar 2009 20:54:28 +0000 (20:54 -0000)
   | 13185   | Bug #227265 - Make pkgsplit() allow "versiony looking parts" |
   | zmedico | in package names, for pms compliance. Also, add              |
   |         | corresponding test cases.                                    |

   | 13186   | Add test case for consecutive hyphens.                       |
   | zmedico |                                                              |

   | 13187   | Bug #227265 - Make pkgsplit() allow multiple consecutive     |
   | zmedico | hyphens in package names, and add corresponding test cases.  |

svn path=/main/branches/prefix/; revision=13196

pym/portage/tests/dep/test_isvalidatom.py
pym/portage/versions.py

index 5d6b4e73a12692a32386c50eeaf5be9a82ea2986..e74ec8ff529b057ce7d714daafd33a4d7e468912 100644 (file)
@@ -61,7 +61,15 @@ class IsValidAtom(TestCase):
                          ( "null/portage*:0", False ),
                          ( ">=null/portage-2.1", True ),
                          ( "~null/portage-2.1", True ),
-                         ( "=null/portage-2.1*", True ),]
+                         ( "=null/portage-2.1*", True ),
+                         ( "=foo/bar-123-1", True ),
+                         ( "=foo/bar-123-1-r1", True ),
+                         ( "=foo/bar--baz-1-r1", True ),
+                         ( "=foo/bar-baz--1-r1", True ),
+                         ( "=foo/bar-baz---1-r1", True ),
+                         ( "=foo/bar-baz---1", True ),
+                         ( "=foo/bar-baz-1--r1", False ),
+               ]
 
                for test in tests:
                        if test[1]:
index a26e550d3f30dfd703b11bd1dca5ea9de865a9f5..c27e13076c3d1d767caee8a11e66bcf74bbf92df 100644 (file)
@@ -242,13 +242,7 @@ def pkgsplit(mypkg,silent=1):
                        print "!!! Name error in",mypkg+": missing a version or name part."
                pkgcache[mypkg]=None
                return None
-       for x in myparts:
-               if len(x)==0:
-                       if not silent:
-                               print "!!! Name error in",mypkg+": empty \"-\" part."
-                       pkgcache[mypkg]=None
-                       return None
-       
+
        #verify rev
        revok=0
        myrev=myparts[-1]
@@ -271,11 +265,6 @@ def pkgsplit(mypkg,silent=1):
                        pkgcache[mypkg]=None
                        return None
                else:
-                       for x in myparts[:verPos]:
-                               if ververify(x):
-                                       pkgcache[mypkg]=None
-                                       return None
-                                       #names can't have versiony looking parts
                        myval=("-".join(myparts[:verPos]),myparts[verPos],revision)
                        pkgcache[mypkg]=myval
                        return myval