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

Replies

Subject Author
Re: [gentoo-alt] unemerging causes a bad symlink removal Fabian Groffen <grobian@g.o>