From: Zac Medico Date: Tue, 9 Jan 2007 20:34:27 +0000 (-0000) Subject: For bug #161003, disallow virtuals in package.provided and document it. Thanks to... X-Git-Tag: v2.1.2~129 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7bd12272120465a6ccc80a2281b6333f7d3a5425;p=portage.git For bug #161003, disallow virtuals in package.provided and document it. Thanks to Robin Johnson for the initial patch. svn path=/main/trunk/; revision=5502 --- 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)