Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 348561 - sys-apps/portage: etc-update should save an example config file
Summary: sys-apps/portage: etc-update should save an example config file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 349307
  Show dependency tree
 
Reported: 2010-12-12 20:51 UTC by Anthony Basile
Modified: 2010-12-21 18:57 UTC (History)
0 users

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


Attachments
A patch against etc-update to save the ._cfg???? files as example configs (save_distribution_config.patch,1.23 KB, patch)
2010-12-12 20:54 UTC, Anthony Basile
Details | Diff
A patch against etc-update to save the ._cfg???? files as example configs (save_distribution_config.patch,1.14 KB, patch)
2010-12-12 23:34 UTC, Anthony Basile
Details | Diff
A patch against etc-update to save the ._cfg???? files as example configs (save_distribution_config.patch,1.09 KB, patch)
2010-12-14 01:44 UTC, Anthony Basile
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2010-12-12 20:51:06 UTC
When running etc-update, the user is offered three options: to replace the current config file, to keep it, or to merge it with the new config.  It would be nice to have a forth option: to just keep the new config file as an example and rename it to something other than ._cfg????_some.config so that it is not a hidden file and is not selected again by etc-update.
Comment 1 Anthony Basile gentoo-dev 2010-12-12 20:54:58 UTC
Created attachment 256985 [details, diff]
A patch against etc-update to save the ._cfg???? files as example configs

The naming convention I adopted is as follows.  If the config file is some.conf then its example config files will be saved as:

some.conf.dist_0000
some.conf.dist_0001
etc.

I'm thinking "dist" is short for "distribution configuration file", something along the lines of what Debian does.  Also I number them sequentially in case the user wants to save more than one and not clobber earlier ones.
Comment 2 Anthony Basile gentoo-dev 2010-12-12 23:34:33 UTC
Created attachment 256993 [details, diff]
A patch against etc-update to save the ._cfg???? files as example configs 

Looking at this again, we don't need the sanity check there, and if we did, we shouldn't have an exit but a return.
Comment 4 Zac Medico gentoo-dev 2010-12-13 07:16:33 UTC
This is fixed in 2.2.0_alpha8, but I'll leave this bug open until it's in an unmasked release.
Comment 5 Anthony Basile gentoo-dev 2010-12-14 01:44:39 UTC
Created attachment 257070 [details, diff]
A patch against etc-update to save the ._cfg???? files as example configs 

Okay, obsessing over style now :)
Comment 7 Zac Medico gentoo-dev 2010-12-14 04:32:44 UTC
I've fixed it to use diff_command to check for duplicate example configs and eliminate them:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25e39c5ee5873c54a038d8b6429cd7c8eb34f0db
Comment 8 Zac Medico gentoo-dev 2010-12-21 18:57:52 UTC
This is fixed in 2.1.9.26.