Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 85222 - Ebuilds with same name in different categories: Overwrites, unusable system
Summary: Ebuilds with same name in different categories: Overwrites, unusable system
Status: VERIFIED LATER
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 07:55 UTC by Klaus Kusche
Modified: 2007-01-12 07: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 Klaus Kusche 2005-03-14 07:55:51 UTC
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
Comment 1 Klaus Kusche 2005-03-14 08:00:34 UTC
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!
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2005-03-14 08:02:21 UTC
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.
Comment 3 SpanKY gentoo-dev 2005-03-14 08:12:23 UTC
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
Comment 4 Klaus Kusche 2005-03-14 11:32:19 UTC
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...
Comment 5 Zac Medico gentoo-dev 2005-09-04 19:36:16 UTC
(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.
Comment 6 Brian Harring (RETIRED) gentoo-dev 2005-09-06 21:42:22 UTC
using $PORTAGE_TMPDIR/$CATEGORY/$P
in rewrite, marking later (screwing around with stable for this isn't a great
notion)
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 14:46:01 UTC
This is fixed by now
Comment 8 Zac Medico gentoo-dev 2007-01-12 07:11:53 UTC
In portage-2.1.2, the build directory paths include $CATEGORY.   Bug 133908 is also fixed in 2.1.2.