Fix grabfile_package() to preprocess atoms before passing them to
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:19:19 +0000 (05:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:19:19 +0000 (05:19 -0000)
isvalidatom() because isvalidatom() has gotten more strict since r12614.
Thanks to ABCD for reporting. (trunk r12622)

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

pym/portage/util.py

index def0d3e40f3a24d694b096abb11d508a2f1aabae..18bbe577b9339ac2cd74170b36f566af37a57bfe 100644 (file)
@@ -281,7 +281,10 @@ def grabfile_package(myfilename, compatlevel=0, recursive=0):
        pkgs=grabfile(myfilename, compatlevel, recursive=recursive)
        for x in range(len(pkgs)-1, -1, -1):
                pkg = pkgs[x]
-               if pkg[0] in '-*': # -atom *pkg for packages file
+               # for packages and package.mask files
+               if pkg[:1] == "-":
+                       pkg = pkg[1:]
+               if pkg[:1] == "*":
                        pkg = pkg[1:]
                if not isvalidatom(pkg):
                        writemsg("--- Invalid atom in %s: %s\n" % (myfilename, pkgs[x]),