From 37a98aa6b8a9935a88aa7973af3a71932c93ec85 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 27 Jan 2007 22:54:55 +0000 Subject: [PATCH] Merged from trunk 5758:5768 Add new ** for package.keywords token to bypass keyword visibility layer (genone) Update package.keywords section in portage(5) with info about new ** token (genone) For bug #142279, detect and warn about null bytes in CONTENTS. Fix broken line number counting for CONTENTS. demote KEYWORDS.missing to a warning to make KEYWORDS='' valid (genone) svn path=/main/branches/prefix/; revision=5797 --- NEWS | 10 ++++++++-- bin/repoman | 1 + man/portage.5 | 26 +++++++++++++++++--------- pym/portage.py | 16 +++++++++++++--- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 562636bab..222b0c562 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,13 @@ News (mainly features/major bug fixes) +portage-2.1.3 +------------- + +* Allow per-module setting of PORTAGE_ELOG_CLASSES +* Add ** as new token for package.keywords to bypass the keyword visibility layer + portage-2.1.2 ------------- +------------- * Ebuilds support default USE flags via +flag in IUSE. * New-style virtuals are now usable for packages that depend on themselves for @@ -32,7 +38,7 @@ portage-2.1.2 * FEATURES="test" automatically implies USE="test". portage-2.1.1 ------------- +------------- * Profiles support use.force, package.use.force, and package.use.mask files. diff --git a/bin/repoman b/bin/repoman index dcb6fe45a..8d44247d6 100755 --- a/bin/repoman +++ b/bin/repoman @@ -200,6 +200,7 @@ qawarnings=[ "DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev", "IUSE.invalid", "KEYWORDS.stupid", +"KEYWORDS.missing", "ebuild.minorsyn", "ebuild.badheader", "file.size", diff --git a/man/portage.5 b/man/portage.5 index 66547521e..4b19dc909 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -384,13 +384,9 @@ Per\-package KEYWORDS. Useful for mixing unstable packages in with a normally stable system or vice versa. This will allow ACCEPT_KEYWORDS to be augmented for a single package. -.nf -\fINote:\fR There are two special KEYWORDS to help out here: -\fB*\fR Match any stable KEYWORD -\fB~*\fR Match any unstable KEYWORD - .I Format: -\- comments begin with # +.nf +\- comment lines begin with # (no inline comments) \- one DEPEND atom per line followed by additional KEYWORDS \- lines without any KEYWORDS imply unstable host arch @@ -403,6 +399,17 @@ media\-video/mplayer \-~x86 net-analyzer/netcat .fi +.I Note: +.fi +In addition to the normal values from ACCEPT_KEYWORDS package.keywords supports +three special tokens: + +.nf +\fB*\fR package is visible if it is stable on any architecture +\fB~*\fR package is visible if it is in testing on any architecture +\fB**\fR package is always visible (KEYWORDS are ignored completely) +.fi + .I Additional Note: If you encounter the \fB-*\fR KEYWORD, this indicates that the package is known to be broken on all systems which are not otherwise listed in KEYWORDS. For @@ -410,10 +417,11 @@ example, a binary only package which is built for x86 will look like: games-fps/quake3-demo-1.11.ebuild:KEYWORDS="-* x86" -If you wish to accept this package anyways, then add \fB-*\fR to your +If you wish to accept this package anyways, then use one of the other keywords in your package.keywords like this: -games-fps/quake3-demo -* +games-fps/quake3-demo x86 + .TP .BR package.mask A list of package atoms to mask. Useful if specific versions of packages do @@ -422,7 +430,7 @@ versions earlier than 1.0.4496. No problem! .I Format: .nf -\- comments begin with # +\- comment lines begin with # (no inline comments) \- one DEPEND atom per line .fi diff --git a/pym/portage.py b/pym/portage.py index ac2b0df7b..1c0f0b441 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6219,6 +6219,8 @@ class portdbapi(dbapi): if matches: inc_pgroups = [] for x in pgroups: + # The -* special case should be removed once the tree + # is clean of KEYWORDS=-* crap if x != "-*" and x.startswith("-"): try: inc_pgroups.remove(x[1:]) @@ -6243,7 +6245,7 @@ class portdbapi(dbapi): hastesting = True elif gp[0] != "-": hasstable = True - if not match and ((hastesting and "~*" in pgroups) or (hasstable and "*" in pgroups)): + if not match and ((hastesting and "~*" in pgroups) or (hasstable and "*" in pgroups) or "**" in pgroups): match=1 if match and eapi_is_supported(eapi): newlist.append(mycpv) @@ -6805,8 +6807,17 @@ class dblink: myc=open(self.dbdir+"/CONTENTS","r") mylines=myc.readlines() myc.close() - pos=1 + null_byte = "\0" + contents_file = os.path.join(self.dbdir, "CONTENTS") + pos = 0 for line in mylines: + pos += 1 + if null_byte in line: + # Null bytes are a common indication of corruption. + writemsg("!!! Null byte found in contents " + \ + "file, line %d: '%s'\n" % (pos, contents_file), + noiselevel=-1) + continue mydat = line.split() # we do this so we can remove from non-root filesystems # (use the ROOT var to allow maintenance on other partitions) @@ -6845,7 +6856,6 @@ class dblink: return None except (KeyError,IndexError): print "portage: CONTENTS line",pos,"corrupt!" - pos += 1 self.contentscache=pkgfiles return pkgfiles -- 2.26.2