1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
Ciaran McCreesh wrote: |
5 |
> On Tue, 12 Sep 2006 10:19:40 +0200 Simon Stelling <blubb@g.o> |
6 |
> wrote: |
7 |
> | > Protected Locations |
8 |
> | > =================== |
9 |
> | > |
10 |
> | > Protected locations are determined by the ``CONFIG_PROTECT`` |
11 |
> | > environment variable, which is defined in the profiles and which |
12 |
> | > may be augmented or overridden by the current environment and user |
13 |
> | > configuration files. This variable contains a space separated list |
14 |
> | > of values which are matched against the beginning of a full file |
15 |
> | > path and name of files to be installed. |
16 |
> | |
17 |
> | "which are matched against the beginning of a full file path" would |
18 |
> | mean that e.g. CONFIG_PROTECT="/etc/foo" would protect the following: |
19 |
> | |
20 |
> | /etc/foobar/doh |
21 |
> | /etc/foo |
22 |
> | /etc/foobaz |
23 |
> | |
24 |
> | .. or did I misunderstand something here? I don't know whether that is |
25 |
> | the current behaviour of portage, but IMO it certainly shouldn't be. |
26 |
> | It should rather be |
27 |
> | |
28 |
> | /etc/foo (file) |
29 |
> | or, if /etc/foo is a dir: |
30 |
> | /etc/foo/* |
31 |
> |
32 |
> Mm. I had a play with this. I'd like someone else to do independent |
33 |
> tests, because I'm seeing something weird here. But it looks like |
34 |
> Portage's current behaviour is: |
35 |
> |
36 |
> with CONFIG_PROTECT="/foo": |
37 |
> * if /foo is a file, it's not protected |
38 |
> * if /foo is a directory, its contents (including subdirectories) are |
39 |
> protected |
40 |
> * /foofoo (file) is not protected |
41 |
> * /foobar/baz is not protected |
42 |
> |
43 |
> and weirdly, with CONFIG_PROTECT="/foo/" |
44 |
> * if /foo/ is a directory, its contents are protected during unmerge |
45 |
> but not during merge |
46 |
> |
47 |
> All of this is rather weird, and doesn't match up to what I've been |
48 |
> told by Portage people that Portage is supposed to do... |
49 |
> |
50 |
|
51 |
I've attached to bug 14321 [1] a patch that I believe implements the |
52 |
CONFIG_PROTECT behavior that most people would expect from portage. |
53 |
The differences from previous behavior are as follows: |
54 |
|
55 |
1) Allows files (not just directories) in CONFIG_PROTECT and |
56 |
CONFIG_PROTECT_MASK. |
57 |
|
58 |
2) Properly accounts for an optional trailing slash on directory paths. |
59 |
|
60 |
3) Prevents /etc/foo from matching /etc/foobaz or /etc/foobaz/bar. |
61 |
|
62 |
Testing of the patch (against portage-2.1.1) would be appreciated. |
63 |
|
64 |
Zac |
65 |
|
66 |
[1] http://bugs.gentoo.org/show_bug.cgi?id=14321#c15 |
67 |
|
68 |
-----BEGIN PGP SIGNATURE----- |
69 |
Version: GnuPG v1.4.5 (GNU/Linux) |
70 |
|
71 |
iD8DBQFFBzhF/ejvha5XGaMRApxqAJ0XcfuqkfNn8L68HLRRynSyXf9grgCcCgok |
72 |
CNysJhEHA5mUvX84vmB8PU0= |
73 |
=KPm0 |
74 |
-----END PGP SIGNATURE----- |
75 |
-- |
76 |
gentoo-dev@g.o mailing list |