Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Controlled emerge -u world
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
janneand
n00b
n00b


Joined: 13 Sep 2002
Posts: 48
Location: Stockholm, Sweden

PostPosted: Fri Dec 13, 2002 4:54 pm    Post subject: Controlled emerge -u world Reply with quote

You're not supposed to do 'emerge -u world' but if the list of updates is huge and you just want to exclude a few it's a hassle. Then the following script may be useful.

It reads from stdin, picks what looks like ebuild names (contains / and -) and send that to emerge, with any parameters sent to the script. That means you can do this...

Code:
emerge -up world > tmp

Then you edit this in a texteditor to remove lines you don't want to include (by deleting them or by putting # at the beginning of the line) and then this...
Code:
cat tmp|listemerge -p


You can also do things like this
Code:
emerge -p xfree|listemerge -p
I have hard to see the usefullness in that though. ;)

-J

Code:
#!/bin/bash
# file: listemerge
# Reads input, picks out what looks like an ebuild,
# strips version and send to emerge.

awk '
{
   if (substr($0, 0, 1) != "#")
      for (i=1; i<=NF; i++) {
         if (index ($i, "/")) {
            numf=split($i, a, "-")
            if (numf > 1) {
               for (j=0; j<numf; j++) {
                  if (a[j] ~ /^[0-9]/)
                     break;
                  if (j>1)
                     printf "-"
                  printf a[j]
               }
               printf "\n"
            }
            next
         }
      }
} '|xargs emerge $@
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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