remove unused vars from xpak, fix bug in compose. Also fix tests for portage sets...
authorAlec Warner <antarus@gentoo.org>
Sun, 22 Jul 2007 10:08:15 +0000 (10:08 -0000)
committerAlec Warner <antarus@gentoo.org>
Sun, 22 Jul 2007 10:08:15 +0000 (10:08 -0000)
svn path=/main/trunk/; revision=7355

pym/portage/sets/__init__.py
pym/portage/xpak.py

index 3e1fbdb2e3ed65d78adb1351ff2acd47034f2eb0..0f4eca16ad1a9e76065854ffca803e29c9a36f27 100644 (file)
@@ -12,6 +12,7 @@ from portage import flatten
 OPERATIONS = ["merge", "unmerge"]
 DEFAULT_SETS = ["world", "system", "everything", "security"] \
        +["package_"+x for x in ["mask", "unmask", "use", "keywords"]]
+del x
 
 class PackageSet(object):
        # Set this to operations that are supported by your subclass. While 
@@ -203,7 +204,7 @@ def make_extra_static_sets(configroot):
        for myname in mysets:
                if myname in DEFAULT_SETS:
                        continue
-               rValue.add(StaticFileSet(fname, os.path.join(mydir, myname)))
+               rValue.add(StaticFileSet(myname, os.path.join(mydir, myname)))
        return rValue
 
 def make_category_sets(portdbapi, settings, only_visible=True):
@@ -224,7 +225,7 @@ if __name__ == "__main__":
                for s in sys.argv[1:]:
                        if s.startswith("category_"):
                                c = s[9:]
-                               l.add(CategorySet("category_%s" % c, c, portdbapi, only_visible=only_visible))
+                               l.add(CategorySet("category_%s" % c, c, portage.db['/']['porttree'].dbapi, only_visible=False))
                        elif os.path.exists(s):
                                l.add(StaticFileSet(os.path.basename(s), s))
                        elif s != "*":
index 2a015571cb93956002313a5af67264cd862dda61..e24da3010501f1a3b82616a55f0100cfa3581f49 100644 (file)
@@ -126,7 +126,6 @@ def xsplit_mem(mydat):
        if mydat[-8:]!="XPAKSTOP":
                return None
        indexsize=decodeint(mydat[8:12])
-       datasize=decodeint(mydat[12:16])
        return (mydat[16:indexsize+16], mydat[indexsize+16:-8])
 
 def getindex(infile):
@@ -251,7 +250,7 @@ class tbz2(object):
                return self.unpackinfo(datadir)
        def compose(self,datadir,cleanup=0):
                """Alias for recompose()."""
-               return recompose(datadir,cleanup)
+               return self.recompose(datadir,cleanup)
        def recompose(self,datadir,cleanup=0):
                """Creates an xpak segment from the datadir provided, truncates the tbz2
                to the end of regular data if an xpak segment already exists, and adds