Handle negated atoms in getmaskingreason().
authorZac Medico <zmedico@gentoo.org>
Wed, 6 Oct 2010 03:59:52 +0000 (20:59 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 6 Oct 2010 03:59:52 +0000 (20:59 -0700)
pym/portage/package/ebuild/getmaskingreason.py

index 04454617909d4947a53ee9769f1cbf5d5b0ff83c..1bc0d8e428860844ec8d2380c824f27daeea75ec 100644 (file)
@@ -60,12 +60,16 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo
                                        pmask_filename = os.path.join(pmask[0], "package.mask")
                                        for i in range(len(pmask[1])):
                                                l = pmask[1][i].strip()
+                                               negated_atom = False
                                                try:
                                                        l_atom = Atom(l, allow_repo=True,
                                                                allow_wildcard=True).without_repo
                                                except InvalidAtom:
                                                        l_atom = None
-                                               if l == "":
+                                                       if l[:1] == '-':
+                                                               negated_atom = True
+
+                                               if negated_atom or not l:
                                                        comment = ""
                                                        comment_valid = -1
                                                elif l[0] == "#":