]>
git.madduck.net Git - code/myrepos.git/blobdiff - mr
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
} #}}}
# run actions on multiple repos, in parallel
} #}}}
# run actions on multiple repos, in parallel
my @fhs;
my @out;
my $running=0;
while (@fhs or @repos) {
while ($running < $jobs && @repos) {
my @fhs;
my @out;
my $running=0;
while (@fhs or @repos) {
while ($running < $jobs && @repos) {
$running++;
my $repo = shift @repos;
my $pid = open(my $fh, "-|");
$running++;
my $repo = shift @repos;
my $pid = open(my $fh, "-|");
open(STDERR, ">&STDOUT");
exit action($action, @$repo);
}
open(STDERR, ">&STDOUT");
exit action($action, @$repo);
}
push @fhs, $fh;
push @out, "";
push @fhs, $fh;
push @out, "";
- reaper();
- $SIG{CHLD}=\&reaper;
- my ($rin, $rout) = ('','', '' );
+ my ($rin, $rout) = ('','');
my $nfound;
foreach my $x (@fhs) {
next unless defined $x;
my $nfound;
foreach my $x (@fhs) {
next unless defined $x;
my $r = '';
if (sysread($fh, $r, 1024) == 0) {
close($fh);
my $r = '';
if (sysread($fh, $r, 1024) == 0) {
close($fh);
+ record($active[$i], $? >> 8);
$fhs[$i] = undef;
$running--;
print $out[$i];
$fhs[$i] = undef;
$running--;
print $out[$i];
}
}
while (@fhs and !defined $fhs[0]) {
}
}
while (@fhs and !defined $fhs[0]) {
shift @fhs;
shift @out;
}
}
} #}}}
shift @fhs;
shift @out;
}
}
} #}}}
-sub reaper { #{{{
- while ((my $pid = waitpid(-1, &WNOHANG)) > 0) {
- record($jobs{$pid}, $? >> 8) if exists $jobs{$pid};
- }
-} #}}}
-
sub record { #{{{
my $dir=shift()->[0];
my $ret=shift;
sub record { #{{{
my $dir=shift()->[0];
my $ret=shift;