Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 261082 - sys-apps/portage: USE-update from a binary does not fetch USE-updated binary
Summary: sys-apps/portage: USE-update from a binary does not fetch USE-updated binary
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 210077 261959
  Show dependency tree
 
Reported: 2009-03-03 16:58 UTC by Kobboi
Modified: 2009-03-13 20:43 UTC (History)
0 users

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


Attachments
fix remote metadata to override local metadata for --getbinpkgonly (getbinpkgonly.patch,516 bytes, patch)
2009-03-04 20:33 UTC, Zac Medico
Details | Diff
fix remote metadata to override local metadata for --getbinpkg (getbinpkg.patch,808 bytes, patch)
2009-03-04 23:08 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kobboi 2009-03-03 16:58:50 UTC
Example with "iperf" and the "threads" USE flag.

On a binary server, I compile "iperf" with "threads" not set.
On a host that uses that binary server, I do "emerge -g iperf" and the binary from the server is fetched.

I now set the "threads" USE flag on both machines.

On the binary server, "emerge -uDN world" leads to the package being recompiled, with "threads" set.
On the host, "emerge -guDN world" leads to the package being recompiled, with "threads" set.

Only if I remove the iperf tbz2 from /usr/portage/packages is the "changed" binary fetched from the server.
It's as if the host does not know there is a "changed" binary available that matches the changed requirements.

For me, this is currently blocking the use of Portage as a tool to maintain a wide range of setups: if I modify the profile (common to server and host) and update the server and then the host, the host will not fetch the binary but attempt a recompile (not only impossible, since it has no access to the internet to fetch the sources, but also undesired because of the compile time)

Note: an emerge -GuDN does not update anything on the host, not from binary, not from ebuild.

Portage: 2.1.6.4

Reproducible: Always

Steps to Reproduce:
Comment 1 Zac Medico gentoo-dev 2009-03-03 17:21:16 UTC
When using the new protocol, it is supposed to replace the local binary package with the remote one if you use -G. However, the -N option will cause the remote package to be rejected if you it's flags are not a perfect match for your local USE settings.

Make sure that you have PORTAGE_BINHOST variable pointing to the directory which corresponds to $PKGDIR on the remote host (not the All/ subdirectory). This is necessary in order for the new protocol to work. If it's pointing at the All/ subdirectory then it will use the old protocol which does not support the behavior that you want.

Please post output for the following commands:

  emerge -pvN iperf
  emerge -pvg iperf
  emerge -pvG iperf
Comment 2 Kobboi 2009-03-03 17:32:20 UTC
Om the host: PORTAGE_BINHOST="ftp://10.11.10.66/AutoDistro/Compiled"

On the server, /AutoDistro/Compiled is a directory with package categories as directories and a Packages file, no All directory (2.1.6.4 is the only Portage version that was ever installed on both machines).

On the host, the following output is produced: (iperf is installed from binary with -threads, now attempting to update with your commands)

#  emerge -pvN iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] net-misc/iperf-2.0.2  USE="ipv6 threads* -debug" 229 kB

#   emerge -pvg iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 threads* -debug" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

# emerge -pvG iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 threads* -debug" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 3 Kobboi 2009-03-03 17:43:21 UTC
The 3 commands I have incorrectly put in the comment above are *after deleting* the -threads binary from the host, which I did to check what would happen then. The problem I report seems to be caused when a "wrong" binary is available locally. Here is the output of the 3 commands in that case:

# emerge -pvN iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] net-misc/iperf-2.0.2  USE="ipv6 threads* -debug" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

# emerge -pvg iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 -debug -threads" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

# emerge -pvG iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 -debug -threads" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 4 Zac Medico gentoo-dev 2009-03-03 18:22:24 UTC
(In reply to comment #3)
> # emerge -pvG iperf
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> [binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 -debug -threads" 
> 
> Total: 1 package (1 reinstall), Size of downloads: 0 kB
> 

It seems as if the package on the server does not have the threads flag enabled. Please post the entry for that package from the ftp://10.11.10.66/AutoDistro/Compiled/Packages file. There should be a local cached copy located at /var/cache/edb/binhost/10.11.10.66/AutoDistro/Compiled/Packages. Also, please verify that the locally cached copy is identical to the remote version.
Comment 5 Kobboi 2009-03-04 12:12:39 UTC
And again I have overlooked something. I hope you can still take me seriously :)
Indeed, the server had the -threads version installed and packaged. I have corrected this and now the host tells me:

# emerge -pvN iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] net-misc/iperf-2.0.2  USE="ipv6 threads* -debug" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

# emerge -pvg iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 -debug -threads" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

# emerge -pvG iperf

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R   ] net-misc/iperf-2.0.2  USE="ipv6 -debug -threads" 

Total: 1 package (1 reinstall), Size of downloads: 0 kB

I check the server Packages file, it says.

CPV: net-misc/iperf-2.0.2
DEPEND: virtual/libc
DESC: tool to measure IP bandwidth using UDP or TCP
IUSE: ipv6 threads debug
KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd
LICENSE: as-is
MD5: c436fb8a24e35f6baa879ae3bfe7436a
MTIME: 1236164521
RDEPEND: virtual/libc
SHA1: 5c8966f059411c8f449a181ca41683434d71bcb1
SIZE: 48733
USE: ipv6 threads
REPO: gentoo

The host Packages file says:
CPV: net-misc/iperf-2.0.2
DEPEND: virtual/libc
DESC: tool to measure IP bandwidth using UDP or TCP
IUSE: ipv6 threads debug
KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd
LICENSE: as-is
MD5: ca75d085c23d817cd04568333d4559ee
MTIME: 1236098145
RDEPEND: virtual/libc
SHA1: 42d955fecb9c0a07ae4a34d7145b17eb847c8d9a
SIZE: 47397
USE: ipv6
REPO: gentoo

The server Packages file cached on the host says:
CPV: net-misc/iperf-2.0.2
DEPEND: virtual/libc
DESC: tool to measure IP bandwidth using UDP or TCP
IUSE: ipv6 threads debug
KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd
LICENSE: as-is
MD5: c436fb8a24e35f6baa879ae3bfe7436a
MTIME: 1236164521
RDEPEND: virtual/libc
SHA1: 5c8966f059411c8f449a181ca41683434d71bcb1
SIZE: 48733
USE: ipv6 threads
REPO: gentoo

Comment 6 Zac Medico gentoo-dev 2009-03-04 20:33:52 UTC
Created attachment 183929 [details, diff]
fix remote metadata to override local metadata for --getbinpkgonly

If this patch is saved as /tmp/getbinpkgonly.patch then it can be applied as follows:

  patch /usr/lib/portage/pym/portage/dbapi/bintree.py /tmp/getbinpkgonly.patch
Comment 7 Kobboi 2009-03-04 22:19:33 UTC
Thanks, I'll try it tomorrow morning (CET).

Two questions:
- will the patch make it into an official release?
- is there a reason for doing it for -G and not for -g?

Comment 8 Zac Medico gentoo-dev 2009-03-04 22:59:39 UTC
(In reply to comment #7)
> - will the patch make it into an official release?

Yes. I'm planning to release it in 2.2_rc24 this weekend, and in 2.1.6.8 the following week.

> - is there a reason for doing it for -G and not for -g?

I guess we can assume that the user always wants to prefer remote package instances when --getbinpkg is enabled, so I'll make it do that in any case.
Comment 9 Zac Medico gentoo-dev 2009-03-04 23:08:01 UTC
Created attachment 183943 [details, diff]
fix remote metadata to override local metadata for --getbinpkg

This does the same thing as the previous patch and also enables the same behavior for --getbinpkg.
Comment 10 Zac Medico gentoo-dev 2009-03-10 09:31:41 UTC
This is fixed in 2.2_rc24 which is in package.mask. I'll close this bug when it's also released in 2.1.6.8.
Comment 11 Zac Medico gentoo-dev 2009-03-13 20:43:27 UTC
This is released in 2.1.6.8.