Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26460 - emerging linux-headers-2.4.19-r1 does not unmerge old package
Summary: emerging linux-headers-2.4.19-r1 does not unmerge old package
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Joshua Kinard
URL:
Whiteboard:
Keywords:
: 32197 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-11 23:11 UTC by Bob Thomas
Modified: 2011-10-30 22:21 UTC (History)
5 users (show)

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


Attachments
files/clean-headers.sh (clean-headers.sh,1.44 KB, text/plain)
2003-10-23 03:42 UTC, TGL
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Thomas 2003-08-11 23:11:21 UTC
When updating linux-headers to 2.4.19-r1, the outdated version 2.4.19 was not
automatically unmerged, even though 2.4.19-r1 overwrites the 2.4.19 files.

Reproducible: Always
Steps to Reproduce:
1. emerge linux-headers-2.4.19
2. emerge linux-headers-2.4.19-r1
3. linux-headers-2.4.19 is not removed




I manually unmerged linux-headers-2.4.19, and got all "!mtime" messages, proving
that 2.4.19-r1 did in fact overwrite all of 2.4.19's files.

It might be package specific, or it might be a problem with autoclean.
Comment 1 Douglas Russell (RETIRED) gentoo-dev 2003-08-15 17:24:44 UTC
Seems to work fine here.

Puggy
Comment 2 TGL 2003-08-26 14:15:51 UTC
Linux-headers packages are in slots corresponding to the version of the kernel they come from. This obviously doesn't make sense since several versions can't coexist. It will become even worst if at some point portage includes some "update inside slots" feature, because if both a 2.4.18-r1 and 2.4.19 versions are "installed" and a 2.4.18-r2 version is available, then the 2.4.19 files will be overwritten by the 2.4.18-r2 "update". (this is an example from real life, while I was testing portage patch from bug #4698)

But this is not a portage bug, only a sys-kernel/linux-headers bug.

I think a possible way to make systems go back to an okay state on next update would be:

 - change all SLOT to "0" in ebuilds

 - add some code into pkg_postinst() to correct existing installed versions slots. I suggest:

  for d in ${ROOT}/var/db/pkg/sys-kernel/linux-headers-*
  do
    echo "0" > ${d}/SLOT
  done

Yes, it's ugly... but has been successfully tested here. 2.4.19 and 2.4.18-r2 were installed. I've patched 2.4.19-r1, and made the update. Then 2.4.19 and 2.4.18-r1 were unmerged by autoclean, and I now have only one package, in slot 0.

A better solution, at portage level, would be some re-sloting directives into portage update files, like there are renamings. I would see them in a separate update files set (to not disturb older portage versions), with, for each package to re-slot, a couple of version numbers and the number of the new slot to affect to versions in this interval. This would be usefull for many packages other than linux-headers (gimp, whose experimental branch has been re-sloted from 1.4 to 2.0, is one that comes to my mind, but I know there have been many others, plus the very old unsloted packages). And here it becomes a portage bug (feature request in fact).

PS: I'll add x86-kernel to CC, since it is the only relevant email I know...
Comment 3 TGL 2003-08-26 14:18:44 UTC
> Then 2.4.19 and 2.4.18-r1 were unmerged by autoclean

Just to make it clear: 2.4.18-r2, not -r1.
Comment 4 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 11:01:39 UTC

*** This bug has been marked as a duplicate of 29324 ***
Comment 5 TGL 2003-09-30 11:27:45 UTC
bug #29324 and this one have just nothing in common:

 - bug #29324 is about some misc package being wrongly unmerged for some
weird
reasons in recent portage version.

 - this bug is about the linux-header package being slotted whereas it should

not. This is an ebuild bug, not dependent on portage (although a clean way
to fix it may depend on portage, see bug #27965).

Martin, can you explain or reopen please?
Thanks.
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 11:48:35 UTC
sorry wrong bug
Comment 7 TGL 2003-10-21 01:42:54 UTC
@Kumba: 

Following your announcement about 2.4.21 kernel-headers release, I CC you

this bug which is also valid for this version. 

To summarize: 
  There are no reason to slot kernel-headers because nobody needs several

version installed at the same time (btw, the best they can do is to 
completly overwrite each other, and the worst is unpredictable). 
  Proposed fix is to:
 - on your side, set SLOT=0 in all kernel-headers ebuilds
 - on portage-dev side, add some kind "slot" command to portage updates 
 as suggested in bug #27965 to allow users going back to a clean system 
 with only one version installed in slot 0. 
 - if the "slot" update command can't be included into portage for some
 reasons, then you can also fix it from kernel-headers ebuilds with the 
 quick and dirty hack in comment #2.
Comment 8 Joshua Kinard gentoo-dev 2003-10-22 21:37:53 UTC
I changed the SLOT Value in the 2.4.21 and 2.4.22 ebuilds to 0 from ${OKV}.
 I don't want to touch the 2.4.19 ebuilds w/o someone testing the 2.4.21
changes first.  Especially since I re-wrote the 2.4.21 ebuild, I feel more
responsible for it's maintainence than the older 2.4.19 ebuild.  I tested
this change on my sparc64 box too, by changing SLOT to 0, merging it, unmerging
the older 2.4.19 and 2.4.22 (must've been some test) versions, and re-merged
2.4.21 again to be safe.  Nothing looks to have broken, which is a good thing.

Also, this really isn't a portage issue, and since I released 2.4.21 into
the wild, I'll take over this bug.  Although the idea about the SLOT tool
might be useful to file as a separate bug assigned to dev-portage (they'll
love you if you include code to partially implement such a tool, btw).

Test 2.4.21 out some, and since it will hopefully replace 2.4.19 in a couple
of weeks, might just roll out this SLOT change when 2.4.21 goes stable. 
Maybe even add a small notice to pkg_postinst() about the SLOT change in
the future.
Comment 9 TGL 2003-10-23 03:41:33 UTC
> I changed the SLOT Value in the 2.4.21 and 2.4.22 ebuilds to 0 

Thanks for having taken this report into account. 

> Also, this really isn't a portage issue

No, sure, but the easiest fix for the users go through a portage 
enhancement. I've already proposed a patch quite some time ago
in bug #27965 that implements this "slot" update command.
When I've done this, one of my test was to add in a portage 
update file the following command:

 "slot sys-kernel/linux-headers sys-kernel/linux-headers 0"

Then, after portage ran the update, all my old kernel headers
entries in the db were reslotted to 0, and the next autoclean
removed the outdated ones automatically. That's why I think
this is really the easiest way to clean users' pkg db, because
it doesn't require anything from the user.

Now, this patch never got into portage (don't know why, I had 
no feedback at all)... So your suggestion about an einfo to 
tell the user to manually do the job sounds good. I would see
something like:

 * If you are upgrading from a version prior to 2.4.21, then run:
 * /usr/portage/sys-kernel/linux-headers/files/clean-headers.sh

(I think a small shell script would be usefull, because
from my experience on forums, most users don't know how to 
unmerge a particular version of a package. I will attach
such a script, feel free to accept/modify/ignore it.)
Comment 10 TGL 2003-10-23 03:42:17 UTC
Created attachment 19661 [details]
files/clean-headers.sh
Comment 11 Joshua Kinard gentoo-dev 2003-10-29 15:02:19 UTC
*** Bug 32197 has been marked as a duplicate of this bug. ***
Comment 12 Joshua Kinard gentoo-dev 2003-10-29 15:04:13 UTC
linux-headers-2.4.21 and 2.4.22 have been corrected.  I've corrected mips-headers
with this same slot issue.  As for 2.4.19, plasmaroo I believe will take
care of that.
Comment 13 Tim Yamin (RETIRED) gentoo-dev 2003-10-29 15:39:51 UTC
All linux-headers ebuilds should now have SLOT="0"...
Comment 14 Joshua Kinard gentoo-dev 2003-10-30 18:11:07 UTC
All done, resolving as FIXED.