View previous topic :: View next topic |
Author |
Message |
punter Guru
Joined: 25 Nov 2002 Posts: 506
|
Posted: Mon Jan 06, 2003 1:20 am Post subject: CONFIG_PROTECT strings |
|
|
Hey guys,
In order to avoid the hassle of updating config files after "emerge -u", I added CONFIG_PROTECT="-*" to my /etc/make.conf
This had extremely bad consequences, most noticable being the corruption of /etc/fstab and /etc/make.conf files at somestages.
I've removed that line from /etc/make.conf, but am back to first step of needing to update files.
I'm looking for a good CONFIG_PROTECT string so that it minimizes the amount of _attention_ required for updating config files, while protecting important files. (ie there are many files like /etc/man.conf which maybe allowed to be updated automatically and some like /etc/fstab which almost never should be allowe dto be changed).
My knowledge of config files barely extends the top mentioned config ones !
Therefore, I would like to ask you, to share your CONFIG_PROTECT strings for the most minimal amount of effort required for updating config files, yet protecting important files, after "emerge -u" commands.
Thanks
Shane |
|
Back to top |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Mon Jan 06, 2003 2:29 am Post subject: Re: CONFIG_PROTECT strings |
|
|
punter wrote: | In order to avoid the hassle of updating config files after "emerge -u", I added CONFIG_PROTECT="-*" to my /etc/make.conf |
what did you expect from such a string?
CONFIG_PROTECT and CONFIG_PROTECT_MASK may hold $IFS (default: space, tab or newline) delimited absolute directory names. i think you can't set them to contain filenames.
hth, jukka |
|
Back to top |
|
|
punter Guru
Joined: 25 Nov 2002 Posts: 506
|
Posted: Mon Jan 06, 2003 9:23 am Post subject: |
|
|
ok, then a simple question.
how do gentoo users cope with this config updating process ?
do users go through all config files which are required to be updated (after emerge -u) and do diff and stuff and analyze one by one ?? isn't this extremely time-consuming ?
there must be a handier way, or some facility or config string out there which i'm unaware of. |
|
Back to top |
|
|
jukka Apprentice
Joined: 06 Jun 2002 Posts: 249 Location: Zurich, Switzerland
|
Posted: Mon Jan 06, 2003 2:39 pm Post subject: |
|
|
punter wrote: | how do gentoo users cope with this config updating process ? |
after an update where config files were changed i run this function: Code: | findcfg()
{
local conf=/etc/make.globals;
[ -r $conf ] && source $conf;
find ${CONFIG_PROTECT:?} -type f -name '._cfg????_*' >/dev/null;
return 0
} |
it shows me which files need to be updated. then i diff all those files and update them as required. yes, one by one, and by hand.
Quote: | isn't this extremely time-consuming ? |
depends on how many files you have to update...
Quote: | there must be a handier way, or some facility or config string out there which i'm unaware of. |
i wouldn't shorten this process. if you really want to and regularly do backups, you can try this: Code: | updatecfg()
{
local fn x
for x in $(findcfg); do
fn="${x##*/}"
mv -i "$x" "${x%/*}/${fn:10}"
done
} | ('findcfg' is a call to the function shown above)
you will be prompted for every config file found whether you want to overwrite it with the new one or not.
hth, jukka |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Mon Jan 06, 2003 3:58 pm Post subject: |
|
|
See this thread for a script that checks whether config files were not modified by you and allows you to update them in one shot (NB. read comments regarding clean/autoclean first though).
etc-update in portage will guide you through update of config files interactively.
You can also maintain a list of files you have modified and write a script to update all other config files automatically (you can even generate this list by checking against the md5sums from the CONTENTS files in /var/db/pkg/...) |
|
Back to top |
|
|
|