Bug #227265 - Make pkgsplit() allow multiple consecutive hyphens in package
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 04:30:54 +0000 (04:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 04:30:54 +0000 (04:30 -0000)
names, and add corresponding test cases. (trunk r13187)

svn path=/main/branches/2.1.6/; revision=13216

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

index a10d730b360aa3bbeca0fcb2dfe093df9957f9b2..e74ec8ff529b057ce7d714daafd33a4d7e468912 100644 (file)
@@ -64,8 +64,10 @@ class IsValidAtom(TestCase):
                          ( "=null/portage-2.1*", True ),
                          ( "=foo/bar-123-1", True ),
                          ( "=foo/bar-123-1-r1", True ),
-                         ( "=foo/bar--baz-1-r1", False ),
-                         ( "=foo/bar-baz--1-r1", False ),
+                         ( "=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 ),
                ]
 
index a5f4c6c1a5fb15bc737c3db142983e1a3a643deb..d3f256dc08864f174bf12b3418d9ad382995cbec 100644 (file)
@@ -219,13 +219,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]