View previous topic :: View next topic |
Author |
Message |
oktay n00b
Joined: 21 Jul 2002 Posts: 5
|
Posted: Thu Feb 20, 2003 7:08 pm Post subject: non-stop 'emerge' script to automate 'emerge world' etc. |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20486
|
Posted: Thu Feb 20, 2003 11:27 pm Post subject: |
|
|
Moved from Portage & Programming. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
|
|
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
|
|