View previous topic :: View next topic |
Author |
Message |
TimSSC Apprentice
Joined: 20 Apr 2006 Posts: 170 Location: Cambridge, MA
|
Posted: Sat Jul 29, 2006 7:03 am Post subject: emerge list from file |
|
|
I am installing the same gentoo system on several machines, and to make the process easier, I wanted to make a file, where eachline is a package to emerge. Therefor, if I wanted to add a package, I would just add it to the list, and emerge the list with the --no-replace option, and if I wanted to install a new system, the package owuld already be there.
The problem is I can't figure out how to feed a file into emerge. Is there a simple scripting way to do this? Or a better way to provide the functions I'm looking for?
thanks. |
|
Back to top |
|
|
intmain Apprentice
Joined: 14 Dec 2005 Posts: 179 Location: Austria
|
Posted: Sat Jul 29, 2006 8:16 am Post subject: |
|
|
If you have a file where each line contains a package name, e.g. packages.list, then you can emerge these packages with
Code: | cat < emerge.list | xargs emerge |
|
|
Back to top |
|
|
TimSSC Apprentice
Joined: 20 Apr 2006 Posts: 170 Location: Cambridge, MA
|
Posted: Sat Jul 29, 2006 5:10 pm Post subject: |
|
|
thanks, that's just what I was looking for. One question though, what is the difference between
Code: | cat < emerge.list | xargs emerge |
and
Code: | cat emerge.list | xargs emerge |
|
|
Back to top |
|
|
intmain Apprentice
Joined: 14 Dec 2005 Posts: 179 Location: Austria
|
Posted: Sun Jul 30, 2006 7:35 am Post subject: |
|
|
In this case there is no difference, you can also write cat emerge.list | xargs emerge (which is of course the shorter form) because cat can read it's input directly from a file. If cat couldn't read it's input directly from a file you would need the <. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9527 Location: beyond the rim
|
Posted: Sun Jul 30, 2006 12:53 pm Post subject: |
|
|
Or a bit simpler:
Code: | emerge $(< emerge.list) |
|
|
Back to top |
|
|
|