public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Bo Ørsted Andresen" <bo.andresen@zlin.dk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world"
Date: Mon, 20 Nov 2006 09:36:42 +0100	[thread overview]
Message-ID: <200611200936.48984.bo.andresen@zlin.dk> (raw)
In-Reply-To: <003801c70c6e$7bb2f4d0$450a0a0a@locutus>

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Monday 20 November 2006 07:37, Daevid Vincent wrote:
> Wondering if someone has a script or shell 'one liner' that can take the
> output of "emerge -avu world" and make a list of the packages (I assume all
> on one line). Then I could pump that back into "emerge -av" again (I don't
> mind if it's a simple manual highlight and copy/append).

You need to replace --ask with --pretend when you send the output into a pipe. 
Otherwise it will wait for input. Also when you send it back to `emerge -av` 
you should add --oneshot in order to avoid that every package on the list 
gets added to the world file.

[SNIP]
> For example:
>
> daevid ~ # emerge -avu world | grep x11-
> [ebuild     U ] x11-misc/util-macros-1.1.2 [1.1.0] USE="-debug" 45 kB
> [ebuild     U ] x11-proto/inputproto-1.4 [1.3.2] USE="-debug" 47 kB
> [ebuild     U ] x11-proto/xproto-7.0.9 [7.0.7] USE="-debug" 138 kB
> [ebuild     U ] x11-libs/xtrans-1.0.2 [1.0.1] USE="-debug" 97 kB
> [ebuild     U ] x11-libs/libX11-1.0.3-r1 [1.0.3] USE="ipv6 -debug" 1,415 kB
> ...
>
> I want to run some command that will give me a list like:
>
> x11-misc/util-macros x11-proto/inputproto x11-proto/xproto ...
>
> Then I could just select and copy that "string" and append it to "emerge
> -av "

I believe [1] should help you understand how this works...:

# emerge -va1 $(emerge -pvu world | 
    sed -n -r 's,^\[ebuild[^]]*\]\ (x11-[^\ ]*).*$,\1,p' |
    sed -r 's/-[^-]+(-r[0-9]+)*$//')

[1] http://www.grymoire.com/Unix/Sed.html

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-11-20  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20  6:37 [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" Daevid Vincent
2006-11-20  8:27 ` Mark M
2006-11-20 20:59   ` Richard Fish
2006-11-20 22:18     ` Daevid Vincent
2006-11-20 22:36       ` Boris Fersing
2006-11-21  0:15         ` b.n.
2006-11-21  1:41           ` Richard Fish
2006-11-21 22:59             ` b.n.
2006-11-20 22:50       ` Hans-Werner Hilse
2006-11-21  9:13     ` Mark M
2006-11-21 10:14       ` Bo Ørsted Andresen
2006-11-20  8:36 ` Bo Ørsted Andresen [this message]
2006-11-21 22:59   ` Daevid Vincent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200611200936.48984.bo.andresen@zlin.dk \
    --to=bo.andresen@zlin.dk \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox