When an ebuild with the same name and the same version exists in two different categories ("foo/xxx-i.j.k" and "bar/xxx-i.j.k"), things get messed up severely: * Both emerges use the same tmpdir. I use keeptemp and keepwork. If xxx-i.j.k still exists after a successful emerge of "foo/xxx", an emerge of "bar/xxx" reuses it, installing the files of "foo/xxx" and registering them as "bar/xxx". * This gives wrong CONTENTS files (containing the files of the other package). When re-emerging or upgrading, the wrong files get unmerged during cleanup (this silently removed the files of one of the system packages in my case, leaving an unusable system). * Both emerges create the same package file in /usr/portage/packages/All, overwriting the package of the other emerge. Consequently, the symlink in /usr/portage/packages/foo/ might suddenly point to a package in All which actually contains bar/xxx and vice versa. Reproducible: Always Steps to Reproduce: 1. create a portage tree overlay which contains an ebuild with the same name and version as an ebuild in the existing portage tree 2. set keeptemp and keepwork 3. repeatedly re-emerge both packages without cleaning between the emerges. Actual Results: 1. package with wrong files in it built and installed 2. wrong files unmerged 3. binary package symlinks point to wrong package Expected Results: keep the tempdirs separated in some way (or force a cleanup) keep the binary packages separated in some way
P.S.: Overwriting of the binary packages also happens when the tmp dir has been removed and the package is recompiled correctly. At least, emerge should cry out loud when it creates a binary package, the link in /usr/portage/packages/foo does not yet exist, but the package in All already does!
The 'keep*' is the reason it's broken, which I would call user error. Why exactly do you have the exact same version and revisions? Are you using emerge or ebuild? Regardless of the above, the addition of a category in the path might be nice.
maybe instead of using $PF in /var/tmp/portage we could use $PF-$CATEGORY ? that would stick best with current behavior and tab-completion :) or if you dont care, i'd vote for using a dirname of $CATEGORY-$PF instead of $CATEGORY/$PF
emerge or ebuild: I use emerge Why duplicate packages with same version: The sys-devel toolchain (gcc, binutils, libs, ...) and several cross toolchains. About keep*: * keep* is responsible for the tmp dir mixup, but not for the bin pkg mixup. * Most likely, it's not only keep*: I think e.g. a parallel emerge of several cross variants of the same base ebuild will suffer from tmp mixup even if keep* is not used. * Especially for long-running builds (like gcc, binutils or glibc) keep* has its benefits when messing around in the tmp tree and rebuilding. Moreover, I really want to be able to check what has been done after the build...
(In reply to comment #3) > or if you dont care, i'd vote for using a dirname of $CATEGORY-$PF instead of $CATEGORY/$PF Another alternative would be ${CATEGORY}%2f${PF} where %2f is the escape sequence for /. I am not sure if it is completely portable though.
using $PORTAGE_TMPDIR/$CATEGORY/$P in rewrite, marking later (screwing around with stable for this isn't a great notion)
This is fixed by now
In portage-2.1.2, the build directory paths include $CATEGORY. Bug 133908 is also fixed in 2.1.2.