Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to undo my configurations (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jorgepeixoto
Apprentice
Apprentice


Joined: 27 Apr 2006
Posts: 218
Location: São José dos Campos, São Paulo, Brasil

PostPosted: Wed Mar 28, 2007 10:59 pm    Post subject: How to undo my configurations (SOLVED) Reply with quote

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
View user's profile Send private message
jseymour
Apprentice
Apprentice


Joined: 23 Jun 2006
Posts: 202
Location: Gainesville Florida

PostPosted: Wed Mar 28, 2007 11:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Wed Mar 28, 2007 11:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
jorgepeixoto
Apprentice
Apprentice


Joined: 27 Apr 2006
Posts: 218
Location: São José dos Campos, São Paulo, Brasil

PostPosted: Thu Mar 29, 2007 2:44 am    Post subject: I do use dispatch-conf Reply with quote

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
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Thu Mar 29, 2007 3:42 am    Post subject: Reply with quote

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
View user's profile Send private message
jorgepeixoto
Apprentice
Apprentice


Joined: 27 Apr 2006
Posts: 218
Location: São José dos Campos, São Paulo, Brasil

PostPosted: Thu Mar 29, 2007 4:20 am    Post subject: Rcs? Reply with quote

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
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Thu Mar 29, 2007 4:32 am    Post subject: Reply with quote

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
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Thu Mar 29, 2007 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
jorgepeixoto
Apprentice
Apprentice


Joined: 27 Apr 2006
Posts: 218
Location: São José dos Campos, São Paulo, Brasil

PostPosted: Sun Apr 01, 2007 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sun Apr 01, 2007 6:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum