I discovered this while attempting to build some PHP binary packages using the
PHP overlay project. I reported this there, but the devs said it's a Portage
issue so I'm reporting it here.
When FEATURES="buildpkg" is set, binary packages are built in
/usr/portage/packages/All/pkg-ver.tbz2. A symlink is then created in
packages/category/pkg-ver.tbz2. However, Portage does not check to see if the
package name is already in use by another package with the same name in a
different category, so a completely different package can be built with the same
name, overwriting the original package.
This causes problems when attempting to build binary packages and distribute
them on multiple servers. "emerge -k" will rebuild one of the identically named
packages every time. "emerge -K" will fail since it will only find one binary
package. This occurred with some php packages, but it could occur with any
"ambiguously named" package that requires category qualification.
The versions would have to match as well for the name to be the same (unlikely
perhaps but it can happen). My test case is to use "app-admin/sudo" and
"app-vim/sudo", which works but only because the version numbers are different.
The case that failed was "dev-php4/pecl-zip" and "dev-php5/pecl-zip", both of
which create a package called "pecl-zip-1.0.tbz2"
Steps to Reproduce:
1. Set FEATURES="buildpkg" in make.conf
2. emerge app-admin/sudo
3. emerge app-vim/sudo
There are now 2 packages with the name "sudo".
4. emerge dev-php4/pecl-zip
5. emerge dev-php5/pecl-zip
6. emerge -K dev-php4/pecl-zip
Step 6 will fail.
*** This bug has been marked as a duplicate of 133908 ***