Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 287333 - sys-apps/portage - emerge: -k may trigger keyword check on installed packages
Summary: sys-apps/portage - emerge: -k may trigger keyword check on installed packages
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 210077 288499
  Show dependency tree
 
Reported: 2009-10-02 10:08 UTC by Sebastian Luther (few)
Modified: 2009-10-11 08:05 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 Sebastian Luther (few) 2009-10-02 10:08:18 UTC
Following situation:

2 systems: binhost + client, both identical portage configuration, identical packages and package versions installed.

Let's say Package A has two versions: 
A-1  arch
A-2  ~arch

At time 1, A-1 is installed and a binary package exists for it, but not for A-2.
Everything is fine.
Ebuilds: A-1 (arch), A-2 (~arch)
Binaries: A-1 (arch)
Installed: A-1 (arch)

At time 2, I keyword A-2. A binary package for A-2 with ~arch gets created and installed.
Everything still fine.
Ebuilds: A-1 (arch), A-2 (~arch)
Binaries: A-1 (arch), A-2 (~arch)
Installed: A-2 (~arch)

At time 3, A-2 is stabilized and I removed it's entry from package.keywords. emerge -uDN world shows no updates on both systems. This ok since stabilization usually touches only the keywords and doesn't change the package in any other way.
So far no problem.
Ebuilds: A-1 (arch), A-2 (arch)
Binaries: A-1 (arch), A-2 (~arch)
Installed: A-2 (~arch)

The problem comes when one runs emerge --uDNk world. What happens is that emerge wants the ebuild of A-2 to be installed. The debug output looks like this:

emerge -1upvqk A
      Arg: A
     Atom: cat/A
   ebuild: cat/A-2
   binary: cat/A-1

emerge -1upvq A
      Arg: A
     Atom: cat/A
   ebuild: cat/A-2
installed: cat/A-2

Why doesn't the first output contain "installed: cat/A-2"?

The reason lies in _select_pkg_highest_available_imp. With -k the code path starting with "if built and matched_packages:" gets triggered. Since it found a binary package of A-1 (remember that the binary of A-2 is masked because of ~arch) "if different_version is not None:" is triggered. This triggers the following check:
if installed and pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata):
continue

Since A-2 was ~arch when it was installed if returns true and the installed version of A-2 is no longer considered.

Note that this only happens if there is a binary package of a version other than the installed available.

It's debatable if the missing keyword check is a necessary, but it should be consistently used (or not used).
Comment 1 Zac Medico gentoo-dev 2009-10-02 19:25:54 UTC
The inconsistency is fixed in r14472, while preserving the behavior required for bug 252167.
Comment 2 Zac Medico gentoo-dev 2009-10-02 20:44:47 UTC
There's another change in r14474, so KEYWORDS from ebuild in tree are used when checking for keyword mask on installed packages.
Comment 3 Zac Medico gentoo-dev 2009-10-04 00:22:37 UTC
This is fixed in 2.2_rc43.
Comment 4 Fab 2009-10-06 16:24:50 UTC
I think I hit the same bug with portage 2.1.6.13, is it possible ?
I have a similar setup (binhost + client with --usepkgonly) and when
a package which was built with ~arch goes stable, I must rebuild the
package to allow the merge on the client.

For example, right now I have gnome-light-2.26 built and merged on the
binhost, but not merged on the client. When it will go stable (very soon),
I think that I'll have to rebuild most of the packages to allow the merge.
Each time it happens, the ebuild embedded in the binary package is keyworded
~arch.
Comment 5 Zac Medico gentoo-dev 2009-10-06 18:09:36 UTC
(In reply to comment #4)
> I think I hit the same bug with portage 2.1.6.13, is it possible ?

Yes, it's the same bug.
Comment 6 Zac Medico gentoo-dev 2009-10-11 01:09:04 UTC
This is fixed in 2.1.7.