Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to import / export eselect settings
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Thu Mar 06, 2014 9:27 pm    Post subject: how to import / export eselect settings Reply with quote

I'm writing a tool to easily compare and merge the configuration between all my gentoo machines, configuration in ALL aspects.

/etc comparison is easy.
/var/lib/portage/world comparision is easy.
kernel config comparision is easy.
grub.cfg comparison is easy.
configuration in user's home directory is not in the scope of this project, this tool is for system configuration only.

Now how can I compare and merge all the eselect settings?
The simplest way I think is to export them into a text file, and import the modified text file after merging.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Fri Mar 07, 2014 11:21 am    Post subject: Reply with quote

I might be mistaken but I think all the settings configured via eselect go into /etc/env.d/ ....

HTH
swimmer
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 349

PostPosted: Fri Mar 07, 2014 1:19 pm    Post subject: Reply with quote

I don't think so.

For example:
"eselect kernel set N" changes the soft-link /usr/src/linux
The result of "eselect kernel list" changes after I manually recreate soft-link /usr/src/linux
Back to top
View user's profile Send private message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Mar 07, 2014 2:21 pm    Post subject: Reply with quote

Yes, using strace on eselect you'll see it actually checks the symlink (in the case of kernel list).
Your tool could just rely on the output of eselect though.

Something like this should do the trick:
Code:
for i in /usr/share/eselect/modules/*; do
    m=`basename $i | sed 's/.eselect//;'`;
    echo $m:;
    eselect $m list;
done


Or, if you're using zsh:
Code:
 for m in /usr/share/eselect/modules/*; do eselect $m:t:r list; done
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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