Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 160863 - Portage should print a warning when a package is listed more than once at package.use
Summary: Portage should print a warning when a package is listed more than once at pac...
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-08 10:58 UTC by Denilson Sá Maia
Modified: 2007-01-08 13:11 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denilson Sá Maia 2007-01-08 10:58:44 UTC
If, in package.use file, we have a package listed more than once, only the latter line will work, because it will "overwrite" or "delete" the useflags set on previous line(s). See bug 149353 for an example of this.

In my humble opinion, Portage should print a warning when finding this. It will avoid the valuable time wasted for the user, looking for what was wrong, and even avoid bugs like that one.

Portage already prints a warning whenever it finds an invalid atom, so I think it should handle this too.

An alternate approach is to make portage "merge" multiple lines into only one, when parsing (instead of overwriting the previous definitions).


Although this bug only talks about package.use, all other package.* files could have the same behavior.
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2007-01-08 11:13:54 UTC
Uhh, portage already combines duplicate entries in package.use. However, I'm not sure if the current stable version has that feature.

kagome ~ # grep amarok /etc/portage/package.use
media-sound/amarok ipod
[ebuild   R   ] media-sound/amarok-1.4.4-r3  USE="ipod musicbrainz opengl xinerama -aac -arts -debug -ifp -kde -mtp -mysql -njb -noamazon -postgres (-real) -visualization"

kagome ~ # echo "media-sound/amarok noamazon" >> /etc/portage/package.use
[ebuild   R   ] media-sound/amarok-1.4.4-r3  USE="ipod musicbrainz noamazon* opengl xinerama -aac -arts -debug -ifp -kde -mtp -mysql -njb -postgres (-real) -visualization"

As for all the other package.* files, combining duplicate entries doesn't really make that much sense for anything other than package.use.
Comment 2 Zac Medico gentoo-dev 2007-01-08 13:11:28 UTC
(In reply to comment #1)
> Uhh, portage already combines duplicate entries in package.use. However, I'm
> not sure if the current stable version has that feature.

That behavior is new in portage-2.1.2.