Gentoo Archives: gentoo-alt

From: Alan Hourihane <alanh@×××××××××××.uk>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] unemerging causes a bad symlink removal
Date: Fri, 28 Aug 2009 07:05:35
Message-Id: 1251461692.19057.84.camel@jetpack.demon.co.uk
In Reply to: Re: [gentoo-alt] unemerging causes a bad symlink removal by Alan Hourihane
1 On Fri, 2009-08-28 at 12:56 +0100, Alan Hourihane wrote:
2 > On Fri, 2009-08-28 at 11:18 +0200, Fabian Groffen wrote:
3 > > On 28-08-2009 10:08:11 +0100, Alan Hourihane wrote:
4 > > > > I guess the problem is more why it wants to remove that /usr. Maybe
5 > > > > because of the same problem we once had during install, where paths
6 > > > > "below" the offset prefix shouldn't be taken into account at all,
7 > > > > because you should not do anything there, and may not even be able to do
8 > > > > so.
9 > > >
10 > > > All you need to do is look at the CONTENTS file which as something like
11 > > > this...
12 > > >
13 > > > dir /usr
14 > > > dir /usr/bin
15 > > > obj /usr/bin/comm 4e28628520359733270907c62c738b3f 1250795126
16 > > > obj /usr/bin/arch 59d8b1d83cfbc020751c8febc4706901 1250795126
17 > > > obj /usr/bin/factor a68ac36164e0ac5c1245e358e688942e 1250795126
18 > > >
19 > > > Look at the first line.... Enough said...
20 > >
21 > > right, but your prefix is '/', so that makes sense.
22 >
23 > Right, normally the "rmdir" would fail because there are files still in
24 > existance in those directories. But with a symlink that doesn't hold
25 > true.
26 >
27 > > the "fix" is most probably that portage shouldn't remove a symlink if it
28 > > expects a dir. Put differently, portage should ensure that it only
29 > > unmerges what it expects. Would that theory work?
30 >
31 > I'm worried about something like this....
32 >
33 > dir /usr/share/mypackage
34 > dir /usr/share/mypackage/test
35 > dir /usr/share/mypackage/symlink-to-test
36 >
37 > Where "symlink-to-test" points to "test" and should be removed. Then
38 > removal of "mypackage" might fail because the symlink would still exist.
39
40 Ah, I see the contents file actually says...
41
42 sym /usr/share/mypackage/symlink-to-test
43
44 in this case.
45
46 So yes, We shouldn't be removing symlinks when it's "dir".
47
48 Alan.

Replies

Subject Author
Re: [gentoo-alt] unemerging causes a bad symlink removal Alan Hourihane <alanh@×××××××××××.uk>