-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ciaran McCreesh wrote: > On Tue, 12 Sep 2006 10:19:40 +0200 Simon Stelling <[EMAIL PROTECTED]> > wrote: > | > Protected Locations > | > =================== > | > > | > Protected locations are determined by the ``CONFIG_PROTECT`` > | > environment variable, which is defined in the profiles and which > | > may be augmented or overridden by the current environment and user > | > configuration files. This variable contains a space separated list > | > of values which are matched against the beginning of a full file > | > path and name of files to be installed. > | > | "which are matched against the beginning of a full file path" would > | mean that e.g. CONFIG_PROTECT="/etc/foo" would protect the following: > | > | /etc/foobar/doh > | /etc/foo > | /etc/foobaz > | > | .. or did I misunderstand something here? I don't know whether that is > | the current behaviour of portage, but IMO it certainly shouldn't be. > | It should rather be > | > | /etc/foo (file) > | or, if /etc/foo is a dir: > | /etc/foo/* > > Mm. I had a play with this. I'd like someone else to do independent > tests, because I'm seeing something weird here. But it looks like > Portage's current behaviour is: > > with CONFIG_PROTECT="/foo": > * if /foo is a file, it's not protected > * if /foo is a directory, its contents (including subdirectories) are > protected > * /foofoo (file) is not protected > * /foobar/baz is not protected > > and weirdly, with CONFIG_PROTECT="/foo/" > * if /foo/ is a directory, its contents are protected during unmerge > but not during merge > > All of this is rather weird, and doesn't match up to what I've been > told by Portage people that Portage is supposed to do... >
I've attached to bug 14321 [1] a patch that I believe implements the CONFIG_PROTECT behavior that most people would expect from portage. The differences from previous behavior are as follows: 1) Allows files (not just directories) in CONFIG_PROTECT and CONFIG_PROTECT_MASK. 2) Properly accounts for an optional trailing slash on directory paths. 3) Prevents /etc/foo from matching /etc/foobaz or /etc/foobaz/bar. Testing of the patch (against portage-2.1.1) would be appreciated. Zac [1] http://bugs.gentoo.org/show_bug.cgi?id=14321#c15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFBzhF/ejvha5XGaMRApxqAJ0XcfuqkfNn8L68HLRRynSyXf9grgCcCgok CNysJhEHA5mUvX84vmB8PU0= =KPm0 -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list