Merged from trunk 5120:5123
authorFabian Groffen <grobian@gentoo.org>
Thu, 23 Nov 2006 17:13:30 +0000 (17:13 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 23 Nov 2006 17:13:30 +0000 (17:13 -0000)
For bug #150585, stack package.keywords incrementally so that -keyword
works as expected for any incremental variable.  This brings the
gvisible and getmaskingstatus logic into sync so that the confusing
(masked by: ) message will not be generated in cases where
package.keywords contains -keyword followed by keyword.

For bug #156014, always round up the next kB so that it doesn't show 0
kB when some small file still needs to be fetched.

Allow -keyword to be matched since some ebuilds use it.  Thanks to Brian
Harring reporting on bug #150585.

svn path=/main/branches/prefix/; revision=5124

bin/emerge
pym/portage.py

index 949587aeb389dc2836f99980a03cc9995db46858..43581cd8176fd2b578f366f43d5908a7e7ff6120 100755 (executable)
@@ -275,6 +275,10 @@ def countdown(secs=5, doing="Starting"):
 def format_size(mysize):
        if type(mysize) not in [types.IntType,types.LongType]:
                return str(mysize)
+       if 0 != mysize % 1024:
+               # Always round up to the next kB so that it doesn't show 0 kB when
+               # some small file still needs to be fetched.
+               mysize += 1024 - mysize % 1024
        mystr=str(mysize/1024)
        mycount=len(mystr)
        while (mycount > 3):
index 6c489e229601d3307e5ed52ceb47311eb4d63747..1c539b528f8054002535603f26603d6eb99629ac 100644 (file)
@@ -4089,6 +4089,18 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
                matches = match_to_list(mycpv, pkgdict[cp].keys())
                for match in matches:
                        pgroups.extend(pkgdict[cp][match])
+               if matches:
+                       inc_pgroups = []
+                       for x in pgroups:
+                               if x != "-*" and x.startswith("-"):
+                                       try:
+                                               inc_pgroups.remove(x[1:])
+                                       except ValueError:
+                                               pass
+                               if x not in inc_pgroups:
+                                       inc_pgroups.append(x)
+                       pgroups = inc_pgroups
+                       del inc_pgroups
 
        kmask = "missing"
 
@@ -5590,6 +5602,18 @@ class portdbapi(dbapi):
                                matches = match_to_list(mycpv, pkgdict[cp].keys())
                                for atom in matches:
                                        pgroups.extend(pkgdict[cp][atom])
+                               if matches:
+                                       inc_pgroups = []
+                                       for x in pgroups:
+                                               if x != "-*" and x.startswith("-"):
+                                                       try:
+                                                               inc_pgroups.remove(x[1:])
+                                                       except ValueError:
+                                                               pass
+                                               if x not in inc_pgroups:
+                                                       inc_pgroups.append(x)
+                                       pgroups = inc_pgroups
+                                       del inc_pgroups
                        hasstable = False
                        hastesting = False
                        for gp in mygroups:
@@ -5598,9 +5622,6 @@ class portdbapi(dbapi):
                                                noiselevel=-1)
                                        match=1
                                        break
-                               elif "-"+gp in pgroups:
-                                       match=0
-                                       break
                                elif gp in pgroups:
                                        match=1
                                        break