Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 8423
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage team <dev-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jozsa Kristof <dyn@ond.vein.hu>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
portage-unmerge-disable-cfgpro.patch disable config protect when unmerging patch Timo Hirvonen 2005-02-28 20:05 0000 599 bytes Details | Diff
localpurge A very dangerous script ;) text/plain Alec Warner 2005-04-25 17:47 0000 3.83 KB Details
untouched_config_files.patch allow the merge phase to overwrite untouched config files patch Zac Medico 2006-11-26 00:04 0000 3.72 KB Details | Diff
untouched_config_files.patch when necessary, bump the mtime to prevent uninstallation of config protected files patch Zac Medico 2006-11-26 05:00 0000 2.68 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8423 depends on: Show dependency tree
Bug 8423 blocks: 147007
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-09-26 14:13 0000
One minor thing: what about checking the rc-updates at package removal? It
really makes no sense eg. to leave the rc script for starting exim if I've
emerge -C -ed exim already :)

------- Comment #1 From Daniel Robbins (RETIRED) 2002-12-10 09:46:10 0000 -------
Not sure if we want to be that clean. We generally leave config files in place.

------- Comment #2 From SpanKY 2003-02-25 15:32:18 0000 -------
from bug 15421 ... add a '--nuke' or like '--veryclean' cmdline option that'll
allow people 
to remove all files that were installed regardless of mtimes 

------- Comment #3 From SpanKY 2003-02-25 15:32:22 0000 -------
*** Bug 15421 has been marked as a duplicate of this bug. ***

------- Comment #4 From SpanKY 2003-07-14 20:00:30 0000 -------
*** Bug 24476 has been marked as a duplicate of this bug. ***

------- Comment #5 From SpanKY 2003-08-02 13:09:44 0000 -------
*** Bug 25759 has been marked as a duplicate of this bug. ***

------- Comment #6 From Ian Leitch (RETIRED) 2003-08-02 14:34:23 0000 -------
I'd realy like such a feature. /etc gets very crouded on Gentoo, mine is 20M,
and thats after some light cleaning. 
Whats the point in leaving config files behind? They're not in use. If a
--config-clean option was introduced, it could spit out a warning telling
people to backup thier configs if needed. They would then have the 5 second
count-down to decide. 

------- Comment #7 From Marius Mauch (RETIRED) 2003-08-03 16:00:35 0000 -------
To delete initscripts/configfiles on unmerging you could simply add /etc/init.d
or /etc to CONFIG_PROTECT_MASK (in make.conf or on the commandline) temporary.
I don't like the idea of a new emerge switch if there is already a simple
solution to do this.

------- Comment #8 From Carsten Lohrke 2003-08-03 16:30:28 0000 -------
There is no flag needed. Just a hash for each config file which is created
while merging, removing unchanged files on unmerging and printing/logging the
ones which remain. The config file protection prevents deleting/overwriting
existing config files and does _not_ help to delete useless files (e.g. if you
accidentally emerged apache2 or switched from syslog to syslog-ng).

------- Comment #9 From Carsten Lohrke 2003-08-03 16:32:04 0000 -------
^^ sysklogd to ...

------- Comment #10 From David M. Andersen 2003-08-05 16:20:56 0000 -------
My suggestion would be to make a standalone tool along the lines of
app-admin/localepurge.

------- Comment #11 From SpanKY 2003-10-04 09:39:38 0000 -------
*** Bug 30287 has been marked as a duplicate of this bug. ***

------- Comment #12 From SpanKY 2004-01-11 14:17:12 0000 -------
*** Bug 37905 has been marked as a duplicate of this bug. ***

------- Comment #13 From SpanKY 2004-02-27 11:22:06 0000 -------
*** Bug 43066 has been marked as a duplicate of this bug. ***

------- Comment #14 From SpanKY 2004-03-30 14:11:30 0000 -------
*** Bug 46162 has been marked as a duplicate of this bug. ***

------- Comment #15 From James Blanding 2004-04-13 21:33:54 0000 -------
How about just adding some output to the end of an emerge that resulted in a
removal being performed...just a simple list of config files that are no longer
in use.  I got bit by the vcron->vixie-cron thing, bug 37905.  If at the end of
the operation, emerge said "By the way, /etc/init.d/vcron is no longer used," I
would have known to delete it.  Just a thought...

------- Comment #16 From SpanKY 2004-08-02 19:49:10 0000 -------
*** Bug 56291 has been marked as a duplicate of this bug. ***

------- Comment #17 From SpanKY 2004-10-07 16:08:00 0000 -------
*** Bug 66609 has been marked as a duplicate of this bug. ***

------- Comment #18 From Hanno Meyer-Thurow 2004-10-08 00:40:03 0000 -------
Well, just one more replying on this thread here. All people I know that use
Gentoo say one thing about it. That it badly misses a purge function like it is
on Debian for a long time.

Please add one function like that.


Cheers

------- Comment #19 From Timo Hirvonen 2005-02-28 19:01:07 0000 -------
*** Bug 83538 has been marked as a duplicate of this bug. ***

------- Comment #20 From Timo Hirvonen 2005-02-28 20:05:35 0000 -------
Created an attachment (id=52335) [details]
disable config protect when unmerging

This very simple patch disables config protect when unmerging package. Changed
(mtime) files are not removed.

------- Comment #21 From Adam 2005-03-09 06:26:28 0000 -------
Would this patch exhibit the problem described in comment 6 of Bug 43066?

------- Comment #22 From Alec Warner 2005-04-25 17:47:44 0000 -------
Created an attachment (id=57230) [details]
A very dangerous script ;)

This script takes a finite number of directories as arguements as well as
options.  See localpurge --help for available options.

This script will get a file list of files in each dir specified on the command
line.  It will then fetch a list of currently installed packages, and their
CONTENTS ( meaning files they own ).  It then compares the files in the current
dir against the CONTENTS of every installed package.  If a file is not found in
any installed pkg's CONTENTS it is marked as orphaned.

The script supports recursion with the --recurse option.  It will print out
orphaned files by default.  To have it prompt you for files to delete, pass the
--remove option.  To have it auto-delete the files ( NOT RECOMMENDED ) add the
--force option.  To stop all the annoying .....'s try the --quiet option.

Note: Running this as "localpurge / --remove --recurse --force" has the
potential to completely destroy your system.  This script will remove any files
not owned by an installed package, which in some cases means IMPORTANT FILES. 
Always use --scan first, and carefully chose what you want gone.

------- Comment #23 From Alec Warner 2005-04-25 17:49:34 0000 -------
Er. bugs with that go to me warnera6@egr.msu.edu, not here BTW :)

------- Comment #24 From SpanKY 2005-07-13 16:58:58 0000 -------
*** Bug 98913 has been marked as a duplicate of this bug. ***

------- Comment #25 From Marius Mauch (RETIRED) 2006-03-09 17:11:16 0000 -------
*** Bug 125655 has been marked as a duplicate of this bug. ***

------- Comment #26 From Zac Medico 2006-03-10 14:01:38 0000 -------
*** Bug 125722 has been marked as a duplicate of this bug. ***

------- Comment #27 From Jan Marten Simons 2006-04-27 07:28:47 0000 -------
I vote for an --exterminate (-X) or --zap (-Z) option, which would remove all
files which were merged, after displaying a warning about this (like
suggested). That way you could keep /etc much cleaner.

------- Comment #28 From Jakub Moc (RETIRED) 2006-06-07 07:03:58 0000 -------
*** Bug 135918 has been marked as a duplicate of this bug. ***

------- Comment #29 From flo 2006-06-10 05:15:20 0000 -------
just an idea for the discussion:

i generally have: /etc/make.conf: AUTOCLEAN="no" on all machines i manage.

what i do when upgrading something is:
# emerge something
# etc-update
# CONFIG_PROTECT="-*" emerge clean

and sometimes:
# emerge something
# CONFIG_PROTECT="-*" emerge clean
# etc-update
this cleans out old untouched config files before diffing

when unmerging:
# CONFIG_PROTECT="-*" emerge unmerge something
so untouched and unneeded config files are removed -> that avoids cruft

i think this config file handling should be default on portage so my split
emerge and emerge clean then could be avoided.

------- Comment #30 From Marius Mauch (RETIRED) 2006-06-10 08:23:19 0000 -------
(In reply to comment #29)
> just an idea for the discussion:
> 
> i generally have: /etc/make.conf: AUTOCLEAN="no" on all machines i manage.
[...]
> i think this config file handling should be default on portage so my split
> emerge and emerge clean then could be avoided.

Definitely not. AUTOCLEAN=no is not supported at all and might be dropped in
the future.

------- Comment #31 From Jakub Moc (RETIRED) 2006-06-11 12:26:37 0000 -------
*** Bug 136461 has been marked as a duplicate of this bug. ***

------- Comment #32 From Simon Stelling (RETIRED) 2006-09-16 02:08:26 0000 -------
(From update of attachment 52335 [details])
The patch breaks one (fairly common) case:

You merge version 1 of a package that installs a config file. The user doesn't
touch the file. Then, you upgrade that package to version 2. Portage will now
put a ._cfg0000_config file into the system and remove the original, leaving
the new version as orphaned update there effectively.

------- Comment #33 From Jason Stubbs (RETIRED) 2006-09-16 03:04:33 0000 -------
(In reply to comment #32)
> (From update of attachment 52335 [details] [edit])
> The patch breaks one (fairly common) case:
> 
> You merge version 1 of a package that installs a config file. The user doesn't
> touch the file. Then, you upgrade that package to version 2. Portage will now
> put a ._cfg0000_config file into the system and remove the original, leaving
> the new version as orphaned update there effectively.

I can't imagine it would be that common.. collision-protect will choke on the
case where two packages share the same config files.

------- Comment #34 From Jason Stubbs (RETIRED) 2006-09-16 03:05:19 0000 -------
Or not... Ok, I'll shut up again.

------- Comment #35 From Simon Stelling (RETIRED) 2006-09-16 04:01:20 0000 -------
It doesn't have to be another package, another version is sufficient to break
it. It's really a typical upgrade scenario :)

------- Comment #36 From Zac Medico 2006-11-25 20:31:55 0000 -------
(In reply to comment #32)
> (From update of attachment 52335 [details] [edit])
> The patch breaks one (fairly common) case:
> 
> You merge version 1 of a package that installs a config file. The user doesn't
> touch the file. Then, you upgrade that package to version 2. Portage will now
> put a ._cfg0000_config file into the system and remove the original, leaving
> the new version as orphaned update there effectively.

I suppose the merge phase can be made a little smarter so that it detects such
a situation in advance and automatically overwrites the untouched config file. 
Before the merge phase merges a config protected file, it will have check the
for a collision with the currently installed package in the same slot and then
see if the colliding file is eligible to be unmerged.  If so, it can
immediately overwrite the file.

------- Comment #37 From Zac Medico 2006-11-26 00:04:17 0000 -------
Created an attachment (id=102733) [details]
allow the merge phase to overwrite untouched config files

This patch should do the job.  Because of bug #16162, we'll also have to modify
etc-update and dispatch-conf so that they don't touch the mtime when they merge
a config file.

------- Comment #38 From Zac Medico 2006-11-26 00:14:02 0000 -------
(In reply to comment #37)
> Because of bug #16162, we'll also have to modify
> etc-update and dispatch-conf so that they don't touch the mtime when they merge
> a config file.

Well, we don't really have to modify etc-update and dispatch-conf.  As long as
the user never modifies the config files of a package, config protection should
never be triggered.  So, my patch alone should solve the problem.

------- Comment #39 From Zac Medico 2006-11-26 01:06:44 0000 -------
This is fixed in svn r5129.

------- Comment #40 From Ciaran McCreesh 2006-11-26 03:01:48 0000 -------
(In reply to comment #37)
> Created an attachment (id=102733) [edit] [details]
> allow the merge phase to overwrite untouched config files

That's not a very good idea if configuration file changes introduce behaviour
changes.

Simple example:

Old version of foo defaults to looking in /var/foo for its data. The user is
happy with this.

New version of foo comes along, and defaults to looking in /srv/foo for its
data. The user does not want this.

The user upgrades. The user has their foo files in /var/foo. The user restarts
foo. Suddenly their foo no longer has any data.

------- Comment #41 From Zac Medico 2006-11-26 03:26:18 0000 -------
(In reply to comment #40)
> New version of foo comes along, and defaults to looking in /srv/foo for its
> data. The user does not want this.

That seems like a reasonably likely scenario.  I'll fix it so that config
protection is triggered in that case.

------- Comment #42 From Zac Medico 2006-11-26 05:00:05 0000 -------
Created an attachment (id=102749) [details]
when necessary,  bump the mtime to prevent uninstallation of config protected
files

This updated version of the previous patch will never overwrite an untouched
config file.  In cases where an installed package in the same slot owns a
protected file that will be merged, the mtime is bumped on the installed file
in order to ensure that it isn't unmerged.

------- Comment #43 From Zac Medico 2006-11-26 06:41:06 0000 -------
In svn r5134:5136 etc-update and dispatch-conf are fixed so that they don't
unnecessarily modify mtime when the user replaces an old config file with an
update that the user hasn't modified.

------- Comment #44 From Charles C. Van Tilburg 2006-11-28 06:54:38 0000 -------
I'd just like to reference my attempted report of a package update bug (udev) 
that is being summarily dismissed by a hostile bug-wrangler, without even a 
single moment of thought:

http://bugs.gentoo.org/show_bug.cgi?id=156505

If a package update fails to remove former package files that are no longer
needed, I'd call that a bug.  

Further, if the package update results in an inability of the package
to run, requiring manual intervention, I'd also call that a bug in the 
update process.

And yes, I did run etc-update.

Peace.

------- Comment #45 From Zac Medico 2006-11-28 14:29:59 0000 -------
This has been released in 2.1.2_rc2-r3.

------- Comment #46 From Jakub Moc (RETIRED) 2006-12-23 10:59:51 0000 -------
*** Bug 158934 has been marked as a duplicate of this bug. ***

------- Comment #47 From Marius Mauch (RETIRED) 2007-01-11 12:06:52 0000 -------
*** Bug 20223 has been marked as a duplicate of this bug. ***

------- Comment #48 From Marius Mauch (RETIRED) 2007-01-11 13:00:01 0000 -------
*** Bug 42027 has been marked as a duplicate of this bug. ***

------- Comment #49 From Jakub Moc (RETIRED) 2007-02-01 06:35:46 0000 -------
*** Bug 164765 has been marked as a duplicate of this bug. ***

------- Comment #50 From Jakub Moc (RETIRED) 2007-02-04 12:23:50 0000 -------
*** Bug 165258 has been marked as a duplicate of this bug. ***

------- Comment #51 From SpanKY 2007-02-09 22:08:13 0000 -------
*** Bug 166083 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug