View previous topic :: View next topic |
Author |
Message |
jorgepeixoto Apprentice
Joined: 27 Apr 2006 Posts: 218 Location: São José dos Campos, São Paulo, Brasil
|
Posted: Wed Mar 28, 2007 10:59 pm Post subject: How to undo my configurations (SOLVED) |
|
|
Hi. If I want to get back some configuration to default, what is the "correct" way to do it?
Example:
There is some file in /etc wich I edited. How can I get it back to detault?
What if the file is in /etc/conf.d/ ?
I suppose I could delete the file and emerge again, but there's got to be a better way.
Last edited by jorgepeixoto on Sun May 13, 2007 1:15 pm; edited 1 time in total |
|
Back to top |
|
|
jseymour Apprentice
Joined: 23 Jun 2006 Posts: 202 Location: Gainesville Florida
|
Posted: Wed Mar 28, 2007 11:13 pm Post subject: |
|
|
I usually just backup the file if I am testing a new configuration. Some editors will automatically make a BAK file of the last edit, Kwrite for one. _________________ WebServerMasters
Gentoo Installation Flash Tutorials |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Wed Mar 28, 2007 11:16 pm Post subject: |
|
|
Well, in the future, don't use etc-update, use dispatch-conf instead. You can set it up to keep track of any changes you make, so you can undo things if you want/need to. As far as getting back to the default, you need the file from the package source (if it's not auto-generated during the build). Check the Gentoo CVS for the version you want:
http://sources.gentoo.org/ _________________ Thomas S. Howard |
|
Back to top |
|
|
jorgepeixoto Apprentice
Joined: 27 Apr 2006 Posts: 218 Location: São José dos Campos, São Paulo, Brasil
|
Posted: Thu Mar 29, 2007 2:44 am Post subject: I do use dispatch-conf |
|
|
I do use dispatch-conf, but some of the files I want to restore are not in my config-archive. One of them is in /etc/conf.d. I don't know if this is because
1) Dispatch-conf does not backup files in /etc/conf.d?
or
2) I modified said files before I started to use dispatch-conf (I don't remember)?
Also, can you answer me:
3) To restore a file from config-archive, I should just copy it manually to is place (normally in /etc) or there is a higher level, automated way?
4) It seems to me that portage only create the ._cfg* files when I update a package. If I simply remerge a package, portage does not create the files.
How can I change this?
How can I take a file in /etc/conf.d to its default? Say, /etc/conf.d/domainname for example?
EDIT: The option --noconfmem seems to answer the question 4 above |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Thu Mar 29, 2007 3:42 am Post subject: |
|
|
I've always just copied stuff in the config-archive manually. You can set up dispatch-conf to use rcs, which might be more flexible. I've never gotten around to trying it out, though. _________________ Thomas S. Howard |
|
Back to top |
|
|
jorgepeixoto Apprentice
Joined: 27 Apr 2006 Posts: 218 Location: São José dos Campos, São Paulo, Brasil
|
Posted: Thu Mar 29, 2007 4:20 am Post subject: Rcs? |
|
|
I see that rcs option in dispatch-conf.conf, but I don't see much explanation of pros x cons... Or even what it is*
In many situations, I don't feel confident to predict the pros and cons from the description of something... I like documentations with point the pros and cons, so that I can make a decision based on what my priorities are.
* It seems to me (I read it in Wikipedia) that RCS is similar to CVS. But Wikipedia says that rcs uses diff. And the dispatch-conf man page says
"changes to config files are stored either using patches or rcs".
When I look in my config-archive, I see that the files are stored as whole files. |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Thu Mar 29, 2007 4:32 am Post subject: |
|
|
Yeah, like I said, I've never gotten around to rcs. It's basically a more limited version control system for text. Not really good for big projects or anything. I guess the man page is wrong there. Since rcs uses diffs, which are basically equivalent to patches, that's not a very useful distinction. I'll look into it. As to advantages, the big advantage with rcs will be a more complete revision history of each file that uses less space, since you don't have full copies dating back to who knows when. _________________ Thomas S. Howard |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Thu Mar 29, 2007 7:41 pm Post subject: |
|
|
One option might be to re-emerge world with CONFIG_PROTECT="" _________________ emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/ |
|
Back to top |
|
|
jorgepeixoto Apprentice
Joined: 27 Apr 2006 Posts: 218 Location: São José dos Campos, São Paulo, Brasil
|
Posted: Sun Apr 01, 2007 2:26 pm Post subject: |
|
|
ppurka wrote: | One option might be to re-emerge world with CONFIG_PROTECT="" |
But, AFAIK, this would overwrite everything without confirmation. I want confirmation because I want to revert only some changes. |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Sun Apr 01, 2007 6:34 pm Post subject: |
|
|
jorgepeixoto wrote: | ppurka wrote: | One option might be to re-emerge world with CONFIG_PROTECT="" |
But, AFAIK, this would overwrite everything without confirmation. I want confirmation because I want to revert only some changes. | You can use the command Code: | equery belongs <filename> | to determine which file belongs to which package and then emerge that particular package with the above CONFIG_PROTECT setting.
Also look into the --config option of emerge. _________________ emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/ |
|
Back to top |
|
|
|