diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-01-09 20:34:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-01-09 20:34:27 +0000 |
commit | 7bd12272120465a6ccc80a2281b6333f7d3a5425 (patch) | |
tree | de8cebf03337f1d18555bf3778228db248efd049 | |
parent | 045385c4f079c6f0f4a30076ae1e366f6d7f5ef4 (diff) | |
download | portage-7bd12272120465a6ccc80a2281b6333f7d3a5425.tar.gz portage-7bd12272120465a6ccc80a2281b6333f7d3a5425.tar.bz2 portage-7bd12272120465a6ccc80a2281b6333f7d3a5425.zip |
For bug #161003, disallow virtuals in package.provided and document it. Thanks to Robin Johnson <robbat2@gentoo.org> for the initial patch.
svn path=/main/trunk/; revision=5502
-rw-r--r-- | man/portage.5 | 5 | ||||
-rw-r--r-- | pym/portage.py | 20 |
2 files changed, 24 insertions, 1 deletions
diff --git a/man/portage.5 b/man/portage.5 index cfe71a672..66547521e 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -207,6 +207,11 @@ For example, if you manage your own copy of a 2.6 kernel, then you can tell portage that 'sys-kernel/development-sources-2.6.7' is already taken care of and it should get off your back about it. +Virtual packages (virtual/*) should not be specified in package.provided. +Depending on the type of virtual, it may be necessary to add an entry to the +virtuals file and/or add a package that satisfies a virtual to +package.provided. + .I Format: .nf \- comments begin with # diff --git a/pym/portage.py b/pym/portage.py index 52d49396d..985ee4e79 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1348,13 +1348,31 @@ class config: pkgprovidedlines = [grabfile(os.path.join(x, "package.provided")) for x in self.profiles] pkgprovidedlines = stack_lists(pkgprovidedlines, incremental=1) + has_invalid_data = False for x in range(len(pkgprovidedlines)-1, -1, -1): + myline = pkgprovidedlines[x] + if not isvalidatom("=" + myline): + writemsg("Invalid package name in package.provided:" + \ + " %s\n" % myline, noiselevel=-1) + has_invalid_data = True + del pkgprovidedlines[x] + continue cpvr = catpkgsplit(pkgprovidedlines[x]) if not cpvr or cpvr[0] == "null": writemsg("Invalid package name in package.provided: "+pkgprovidedlines[x]+"\n", noiselevel=-1) + has_invalid_data = True del pkgprovidedlines[x] - + continue + if cpvr[0] == "virtual": + writemsg("Virtual package in package.provided: %s\n" % \ + myline, noiselevel=-1) + has_invalid_data = True + del pkgprovidedlines[x] + continue + if has_invalid_data: + writemsg("See portage(5) for correct package.provided usage.\n", + noiselevel=-1) self.pprovideddict = {} for x in pkgprovidedlines: cpv=catpkgsplit(x) |