Sunday, May 11, 2008

accept input from stdin

if possible emerge-ng should be able to accept input from .

e.g. cat packagelist | emergeng

thus far neither portage nore pkgcore have this capability.

5 comments:

Ciaran McCreesh said...

xargs. Learn it.

xenoterracide said...

yes Ciaran there is more than one way to skin a cat. It was also suggested to use a for loop. But both of these seem to be workarounds. although perhaps I am wrong in this case.

Anonymous said...

lern2unix, noob

Anonymous said...

Hey, don't forget:

  emerge $(<package-list)

But, seriously, this seems like a feature that would not be very useful to add to the package manager by itself. Are you maybe looking for package sets?

steveL said...

Well you can do this with update[1]:

UPDATE_FILE=packages update

Not quite the same as stdin, but same as your example with only one command and no subshell. Haven't used it in ages, though. I agree sets do a lot of what you're after, and most of the rest would be with update -Nr where N is 0-9, for me at least ;)

[1] http://forums.gentoo.org/viewtopic-t-546828.html
You can use it with any of the 3 package managers, though we haven't tested paludis. see update -h config if you do try it.