Skip to content

Instantly share code, notes, and snippets.

@kentfredric
Created October 21, 2009 21:42
Show Gist options
  • Save kentfredric/215491 to your computer and use it in GitHub Desktop.
Save kentfredric/215491 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Sys::Syslog;
use IPC::Run::Fused qw( run_fused );
use Data::Dumper qw( Dumper );
$Data::Dumper::Indent = 0;
sub do_log {
my ( $name, $opts, $code ) = @_;
openlog( $name, $opts, 'user' );
my $error;
{
local $@;
eval { $code->(); };
$error = $@;
}
closelog();
die $error if $error;
}
sub run_syslogged {
my ( $message, @rest ) = @_;
do_log( $message, 'pid', sub {
syslog('info', "Calling : ". Dumper([ @rest ]));
run_fused( my $fh, @rest ) || die "Run Fused failed :( $@ ";
while ( my $line = <$fh> ) {
chomp $line;
syslog( 'info', $line );
}
close $fh;
} );
}
my @repos = ();
push @repos, qw( kde vdr-testing x11 berkano gentoo gnash-cvs );
push @repos, qw( ikelos java-overlay kde3 mozilla php-experimental );
push @repos, qw( php-testing postgresql-experimental postgresql-testing );
push @repos, qw( qting-edge toolchain );
chdir '/var/paludis/repositories/perl-git/';
run_syslogged( 'paludis --sync perl', qw( sudo -u kent bash ./rebase.sh ) );
run_syslogged( 'paludis --sync perl', qw( sudo -u kent git checkout mergemaster ) );
run_syslogged( 'paludis --sync ', qw( paludis --sync ), @repos );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment