Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
non-stop 'emerge' script to automate 'emerge world' etc.
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
oktay
n00b
n00b


Joined: 21 Jul 2002
Posts: 5

PostPosted: Thu Feb 20, 2003 7:08 pm    Post subject: non-stop 'emerge' script to automate 'emerge world' etc. Reply with quote

Ever started 'emerge world' at night only to find out next morning that one of the packages failed to merge and the whole thing stopped ? :)

Here's a basic script to solve that problem. (Sorry if this is already built into portage.. it should be if it's not)

Code:

#!/usr/bin/perl  -w

use strict;

# Non Stop Emerge after a package fails!

# normally emerge stops after a failed package
# and doesn't try to install the rest of the packages
# This script solves that problem by executing 'emerge'
# seperately for each package (if it fails. it only fails for one package)

# probably can't handle things like restart after an update of the 'portage' package

if (scalar @ARGV < 1 ) {
   print "\n\n\tUsage: $0 package1[,package2, package3,..] \n";
   print "\n\t(\"$0 world\" is valid)\n\n";
   exit();
}


my ($command, $emerge, @return);

$emerge = "/usr/bin/emerge";
$command = "$emerge -p @ARGV";
@return = `$command`;

foreach(@return){
   $_ =~ /.*\] (.*\/.*)-\d.*/  ;
   if (defined $1)   {
      print "\n\n Emerging Package: $1 \n\n " ;
      sleep 3;
      system("$emerge $1");
   }
}   


Also available:
http://altunergil.org/attic/nonstop-emerge.pl
http://altunergil.org/attic/nonstop-emerge.pl.txt

PS: no flame, no warranties.

oktay
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20498

PostPosted: Thu Feb 20, 2003 11:27 pm    Post subject: Reply with quote

Moved from Portage & Programming.
_________________
Quis separabit? Quo animo?
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