From e929ec1a1c45577d21742c441be0889b29fdbf63 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 23 Nov 2006 17:13:30 +0000 Subject: [PATCH] Merged from trunk 5120:5123 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 | 4 ++++ pym/portage.py | 27 ++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/bin/emerge b/bin/emerge index 949587aeb..43581cd81 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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): diff --git a/pym/portage.py b/pym/portage.py index 6c489e229..1c539b528 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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 -- 2.26.2