Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 139842 - has_version and built_with_use ignore package.provided
Summary: has_version and built_with_use ignore package.provided
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 163435 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-09 20:54 UTC by Paul Bredbury
Modified: 2007-01-23 20:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
portageq.patch (portageq.patch,560 bytes, patch)
2006-07-30 19:12 UTC, Paul Bredbury
Details | Diff
eutils.eclass.patch (eutils.eclass.patch,622 bytes, patch)
2006-07-30 19:13 UTC, Paul Bredbury
Details | Diff
irc.log (irc.log,10.29 KB, text/plain)
2006-08-06 12:45 UTC, Paul Bredbury
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Bredbury 2006-07-09 20:54:25 UTC
Hi, as seen in bug #139693, built_with_use will return 0 (True) if the package's USE *file* doesn't exist. However, a package can't possibly be built with any USE *flag* if it's not even installed (i.e. built).

In built_with_use() in eutils.eclass, the function should distinguish between the package being installed, not installed, package.provided or injected. It's not obvious how to do that, though.

If has_version were aware of package.provided and injected packages, then built_with_use() could contain near its start:

	if ! has_version $1 ; then
		# Package is not installed
		return 1
	fi
Comment 1 Paul Bredbury 2006-07-30 19:12:02 UTC
Created attachment 93098 [details, diff]
portageq.patch

Fixes has_version to look in package.provided.
Comment 2 Paul Bredbury 2006-07-30 19:13:27 UTC
Created attachment 93099 [details, diff]
eutils.eclass.patch

Fixes built_with_use to use the fixed has_version.
Comment 3 SpanKY gentoo-dev 2006-08-05 14:01:38 UTC
if you're using built_with_use on a package that isnt installed, then your ebuild logic is flawed in a larger sense

perhaps the correct fix would be to just call 'die'
Comment 4 Paul Bredbury 2006-08-05 14:30:58 UTC
(In reply to comment #3)
> if you're using built_with_use on a package that isnt installed, then your
> ebuild logic is flawed in a larger sense

Nope, it is Portage's logic that is flawed (and fixed by these patches). Having to work around Portage's flaws in ebuilds, rather than fixing Portage's commands so that they do not produce the *opposite* result of what anyone would reasonably expect, is no way to program.

There are two bugs which these patches fix:

* has_version ignores package.provided.
* built_with_use is wrong, as mentioned above.

Should I split this into 2 bugs rather than 1?
Comment 5 SpanKY gentoo-dev 2006-08-05 15:23:26 UTC
two different issues

file a new bug about the has_version as that is a portage issue

as for built_with_use, my previous comment still stands
Comment 6 Paul Bredbury 2006-08-06 12:45:57 UTC
Created attachment 93613 [details]
irc.log

Here's the discussion on IRC, for reference. Note that the sentence "i can come up with a circumstance going the opposite direction where yours breaks but mine works" on line 94 turns out to be false.
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-01-23 20:16:59 UTC
*** Bug 163435 has been marked as a duplicate of this bug. ***