Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 25478

Summary: Add optional feature to improve CONFIG_PROTECT and minimize etc-updates
Product: Portage Development Reporter: William Totten <biell>
Component: Enhancement/Feature RequestsAssignee: Nicholas Jones (RETIRED) <carpaski>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: 2.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description William Totten 2003-07-28 20:58:48 UTC
What I would like to see is a new "FEATURES" item which would allow you to have
files normally protected by CONFIG_PROTECT to be automatically updated if they
have not been changed from their default.  For example, I think /etc/syslog.conf
is fine from the factory, and if it changes that will probably be fine too.

This diff (modified to remove spaces to show the changes I propose) would update
to this behavior in the current stable release of portage using a "FEATURES"
keyword "smart_config_protect":

*** /tmp/portage.py Mon Jul 21 00:21:38 2003
--- portage.py  Mon Jul 21 00:23:23 2003
***************
*** 4628,4633 ****
--- 4628,4637 ----
       os.utime(mydest,(thismtime,thismtime))
       zing="---"
       moveme=0
+  elif cycled and ("smart_config_protect" in features):
+      #mymd5!=destmd5 and we've cycled, but smart_config is on; move mysrc
+      moveme=1
+      cfgfiledict[myrealdest]=[mymd5]
   elif cycled:
       #mymd5!=destmd5 and we've cycled; move mysrc into place as a ._cfg file
       moveme=1

If you like it, but would like a full diff to fully understand:
http://drumlin.thehutt.org/portage/portage.py-diff

I know people might think this is drastic, but think about it.  Most of us only
update 1-2 dozen /etc/files.  I batch up my etc-update's and generally don't get
to them until there are well over 50 files to update.  Now, I know that I could
get rid of many of them by masking the directories, but I think this is
fundamentally better.  I also think it solves a large portion of the etc-update
question brought up in the Eurpoean conference a couple weeks ago.

I am actually running with this, and my life is easier.

Thanks for your time, and your valued work on the portage system thus far.
Comment 1 SpanKY gentoo-dev 2003-07-28 21:15:22 UTC
please post your stuff to Bug 11763, it's good :) 

*** This bug has been marked as a duplicate of 11763 ***