Make pkgsplit and catpkgsplit return imutable tuples instead of mutable lists so...
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Jun 2007 14:47:39 +0000 (14:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Jun 2007 14:47:39 +0000 (14:47 -0000)
svn path=/main/trunk/; revision=6749

pym/emerge/__init__.py
pym/portage/versions.py

index 67d70bee10f860c1b214d18148af76011fde24a2..0db3862f30129be02a4f11949246630c722f76ba 100644 (file)
@@ -2684,7 +2684,7 @@ class depgraph:
                                        else:
                                                verboseadd += "[No ebuild?]"
 
-                               xs=portage.pkgsplit(x[2])
+                               xs = list(portage.pkgsplit(x[2]))
                                if xs[2]=="r0":
                                        xs[2]=""
                                else:
index 95d7340a3c4ed24e3ee53676728349fefd799906..ebf8cbada9d390750c62cd03b92d101300757ac7 100644 (file)
@@ -200,7 +200,7 @@ def pkgsplit(mypkg,silent=1):
        try:
                if not pkgcache[mypkg]:
                        return None
-               return pkgcache[mypkg][:]
+               return pkgcache[mypkg]
        except KeyError:
                pass
        myparts=mypkg.split("-")
@@ -243,9 +243,9 @@ def pkgsplit(mypkg,silent=1):
                                        pkgcache[mypkg]=None
                                        return None
                                        #names can't have versiony looking parts
-                       myval=["-".join(myparts[:verPos]),myparts[verPos],revision]
+                       myval=("-".join(myparts[:verPos]),myparts[verPos],revision)
                        pkgcache[mypkg]=myval
-                       return myval[:]
+                       return myval
        else:
                pkgcache[mypkg]=None
                return None
@@ -273,7 +273,7 @@ def catpkgsplit(mydata,silent=1):
        try:
                if not catcache[mydata]:
                        return None
-               return catcache[mydata][:]
+               return catcache[mydata]
        except KeyError:
                pass
        mysplit=mydata.split("/")
@@ -288,8 +288,9 @@ def catpkgsplit(mydata,silent=1):
                catcache[mydata]=None
                return None
        retval.extend(p_split)
+       retval = tuple(retval)
        catcache[mydata]=retval
-       return retval[:]
+       return retval
 
 def catsplit(mydep):
         return mydep.split("/", 1)