Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 14321 - CONFIG_PROTECT_FILES & CONFIG_PROTECT_FILES_MASK
Summary: CONFIG_PROTECT_FILES & CONFIG_PROTECT_FILES_MASK
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 32927 40884 99744 152579 (view as bug list)
Depends on: 22064
Blocks: 7093 16428 18778 147007
  Show dependency tree
 
Reported: 2003-01-21 17:25 UTC by Mr. Bones. (RETIRED)
Modified: 2011-10-30 22:20 UTC (History)
8 users (show)

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


Attachments
portage-2.0.51-r1-CONFIG_PROTECT_FILES.patch (portage-2.0.51-r1-CONFIG_PROTECT_FILES.patch,7.64 KB, patch)
2004-02-10 10:58 UTC, Sven Wegener
Details | Diff
protect files for portage-2.1.1 (config_protect.patch,3.62 KB, patch)
2006-09-12 15:28 UTC, Zac Medico
Details | Diff
protect files for portage-2.1.1 (config_protect.patch,3.94 KB, patch)
2006-09-12 20:27 UTC, Zac Medico
Details | Diff
make emerge scan for individual files (chk_updated_cfg_files.patch,1.69 KB, patch)
2006-09-13 16:02 UTC, Zac Medico
Details | Diff
etc-update support for individual files (etc-update.patch,1.03 KB, patch)
2006-09-14 14:14 UTC, Zac Medico
Details | Diff
dispatch-conf support for individual files (dispatch-conf.patch,1.58 KB, patch)
2006-09-14 15:01 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mr. Bones. (RETIRED) gentoo-dev 2003-01-21 17:25:54 UTC
Every time I emerge the new version of bash_completion, I have to etc-update
and move the new version in to place.  I'd much rather be able to
add /etc/bash_completion to CONFIG_PROTECT_MASK and have the file over-written
automatically each time while still PROTECTing the rest of /etc.

Should be straight forward.  Is there any down-side?
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2003-01-23 14:23:58 UTC
No.

That would be a major performance hit when merging and unmerging.
Maybe it could be implemented later with some fancy caching and
matching logic, but not in the immediate future.

It would be messy to do so presently anyway as not all packages
specify a '/' after the directory and thus would be a source of
confusion. If implemented it will be for a seperate variable.
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2003-02-21 05:39:52 UTC
blah
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2003-02-21 13:31:32 UTC
ok, I'll bite.

What does "blah" mean? ;-)
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-02-23 02:32:34 UTC
Vapier has ebuilds that depend on this.

Apparently I was conscious when closing this, as it
was supposed to be a 'wontfix'.
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2003-03-04 15:41:29 UTC
For the case at hand, wouldn't it make more sense for bash_completion to 
install in /usr/share instead of /etc ?  It isn't actually a config file.
Comment 6 SpanKY gentoo-dev 2003-03-04 19:45:02 UTC
Bug 9176 ... basically, bash_completion is going to stay in /etc/
Comment 7 Nicholas Jones (RETIRED) gentoo-dev 2003-12-23 23:20:32 UTC
*** Bug 32927 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2004-02-09 06:30:38 UTC
*** Bug 40884 has been marked as a duplicate of this bug. ***
Comment 9 Sven Wegener gentoo-dev 2004-02-10 10:56:52 UTC
Hi, just digged myself through the portage code and came
up with the attached solution. Patch is against 2.0.50-r1.

CONFIG_PROTECT_FILES and CONFIG_PROTECT_FILES_MASK take
precedence over CONFIG_PROTECT and CONFIG_PROTECT_MASK.

Performance is still fine from my side. Did several
(un)merges of app-office/openoffice with various CONFIG_PROTECT*
settings on /opt/OpenOffice*

Things that still need to be done:
- update equery from app-portage/gentoolkit to allow query
  of CONFIG_PROTECT_FILES(_MASK)
- update etc-update to handle protected files
  (thinking about rewriting it in python)
- Testing ;)
Comment 10 Sven Wegener gentoo-dev 2004-02-10 10:58:02 UTC
Created attachment 25352 [details, diff]
portage-2.0.51-r1-CONFIG_PROTECT_FILES.patch
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2005-07-21 01:09:00 UTC
*** Bug 99744 has been marked as a duplicate of this bug. ***
Comment 12 Daniel Lawson 2005-07-21 02:52:31 UTC
replying here, carried on from http://bugs.gentoo.org/show_bug.cgi?id=99744

>> /etc/services
>
>Don't know what's so critical about this one... Some ebuilds also need to
>install additional entries there.

Yes, this is part of the problem. /etc/services is a real pain to manage if
there are a large number of site-local modifications (eg. from installed
ebuilds), and baselayout pushes out a new /etc/services - *without* the
modifications made by said ebuilds.

I can't seem to reproduce this particular bug right now, but I'll see about
reproducing it later.
Comment 13 Jason Stubbs (RETIRED) gentoo-dev 2005-10-07 07:03:18 UTC
I'm not seeing the bug here. Can someone summarize it please? 
Comment 14 Micha Krause 2006-08-01 04:58:37 UTC
(In reply to comment #13)
> I'm not seeing the bug here. Can someone summarize it please? 
> 

Comment 15 Zac Medico gentoo-dev 2006-09-12 15:28:45 UTC
Created attachment 96837 [details, diff]
protect files for portage-2.1.1

This patch fixes the ConfigProtect class so that it properly accounts for config protected/masked files. In addition, it does a couple more things:

1) properly accounts for an optional trailing / on directory paths
2) prevents /etc/foo from matching /etc/foobaz or /etc/foobaz/bar

I've created this patch in response to "RFC: Package Manager Specification: configuration protection" discussion of the -dev mailing list:

http://thread.gmane.org/gmane.linux.gentoo.devel/42270
Comment 16 Zac Medico gentoo-dev 2006-09-12 20:27:57 UTC
Created attachment 96850 [details, diff]
protect files for portage-2.1.1

This updated patch fixes the merge phase so that it properly protects or masks single files.
Comment 17 Zac Medico gentoo-dev 2006-09-13 16:02:31 UTC
Created attachment 96915 [details, diff]
make emerge scan for individual files

This adds support to emerge so that it scans for updates to individual files listed in CONFIG_PROTECT.  Config update tools such as etc-update and dispatch-conf will need to be modified to support this as well.
Comment 18 Zac Medico gentoo-dev 2006-09-14 14:14:45 UTC
Created attachment 97005 [details, diff]
etc-update support for individual files
Comment 19 Zac Medico gentoo-dev 2006-09-14 15:01:54 UTC
Created attachment 97009 [details, diff]
dispatch-conf support for individual files

This patch completes portage support for individual files in CONFIG_PROTECT and CONFIG_PROTECT_MASK.
Comment 20 Zac Medico gentoo-dev 2006-09-15 17:52:34 UTC
This is in svn r4457:4461.
Comment 21 Zac Medico gentoo-dev 2006-09-15 20:30:40 UTC
This has been released in 2.1.2_pre1.
Comment 22 Zac Medico gentoo-dev 2006-10-28 19:46:15 UTC
*** Bug 152579 has been marked as a duplicate of this bug. ***