mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-21 21:47:54 +00:00
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/parallel
This commit is contained in:
commit
ad3cb3e6fd
|
@ -159,11 +159,15 @@ xargs or cat | sh.</description>
|
|||
<implementation id="sha1new=f8bb74a654d9db954642779d05d085f49a884237" released="2013-07-23" version="20130722">
|
||||
<manifest-digest sha256new="55EVKHCPVW6O5F5RYWCYRH7P6MJ2FYQ3TYXAD2CM4ASVB5JQ6SLA"/>
|
||||
<archive extract="parallel-20130722" href="http://ftpmirror.gnu.org/parallel/parallel-20130722.tar.bz2" size="245705"/>
|
||||
</implementation>
|
||||
<implementation id="sha1new=6630fe548b975264e87b6dbadfadb2fdc402b938" released="2013-08-26" version="20130822">
|
||||
<manifest-digest sha256new="CPD27BRNTCCOD3UZVTCKP7AL3XHJOBOWM75J2HE2N3ANZ3AZXJ5Q"/>
|
||||
<archive extract="parallel-20130822" href="http://ftpmirror.gnu.org/parallel/parallel-20130822.tar.bz2" size="270689"/>
|
||||
</implementation>
|
||||
</group>
|
||||
</interface>
|
||||
<!-- Base64 Signature
|
||||
iEYEABECAAYFAlHuJGcACgkQ/lhgK1iJTtImYACghf1EdeotOCcE84zqBf8VWCZFLmEAn3lMXUMU
|
||||
KKcEhYVWTdtgUeL5jAyH
|
||||
iEUEABECAAYFAlIbM/QACgkQ/lhgK1iJTtKIOwCgtJirkjgy0bWJVXooZtsvWd/EcqIAmNzgQajN
|
||||
UYaU5aOneAQ9k7qK/AI=
|
||||
|
||||
-->
|
||||
|
|
|
@ -16,7 +16,7 @@ wget "$url.sig" -O "${file}.sig"
|
|||
gpg -n --verify "${file}.sig" "${file}" 2>&1 | tee "${file}.gpglog"
|
||||
set +x
|
||||
KEYID="$(grep '^Primary key fingerprint:' "${file}.gpglog" | tr -d ' ' | cut -f 2 -d : )"
|
||||
fingerprint="BE9CB49381DE3166A3BC66C12C6229E2FFFFFFF1"
|
||||
fingerprint="CDA01A4208C4F74506107E7BD1AB451688888888"
|
||||
if [ "$KEYID" != "$fingerprint" ]; then
|
||||
echo "Signature verification FAILED:"
|
||||
cat "${file}.gpglog"
|
||||
|
|
11
src/niceload
11
src/niceload
|
@ -367,6 +367,7 @@ sub start {
|
|||
}
|
||||
|
||||
use POSIX ":sys_wait_h";
|
||||
use POSIX qw(:sys_wait_h);
|
||||
|
||||
sub REAPER {
|
||||
my $stiff;
|
||||
|
@ -397,8 +398,14 @@ sub kill_child_TSTP {
|
|||
|
||||
sub kill_child_INT {
|
||||
my $self = $Global::process;
|
||||
::debug("SIGINT received. Killing $self->{'pid'} Exit\n");
|
||||
kill INT => $self->pgrp();
|
||||
::debug("SIGINT received.\n");
|
||||
if(not @opt::pid) {
|
||||
::debug("Killing $self->{'pid'} Exit\n");
|
||||
kill INT => $self->pgrp();
|
||||
} else {
|
||||
::debug("Continue pids $self->{'pid'} Exit\n");
|
||||
kill CONT => $self->pgrp();
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
29
src/parallel
29
src/parallel
|
@ -207,6 +207,15 @@ if($opt::filter_hosts and (@opt::sshlogin or @opt::sshloginfile)) {
|
|||
}
|
||||
|
||||
if($opt::nonall or $opt::onall) {
|
||||
sub tmp_joblog {
|
||||
my $joblog = shift;
|
||||
if(not defined $joblog) {
|
||||
return undef;
|
||||
}
|
||||
my ($fh, $tmpfile) = ::tempfile(SUFFIX => ".log");
|
||||
close $fh;
|
||||
return $tmpfile;
|
||||
}
|
||||
# Copy all @fhlist into tempfiles
|
||||
my @argfiles = ();
|
||||
for my $fh (@fhlist) {
|
||||
|
@ -234,7 +243,7 @@ if($opt::nonall or $opt::onall) {
|
|||
join(" ",
|
||||
((defined $opt::u) ? "-u" : ""),
|
||||
((defined $opt::group) ? "-g" : ""),
|
||||
((defined $opt::joblog) ? "--joblog $opt::joblog" : ""),
|
||||
((defined $opt::files) ? "--files" : ""),
|
||||
((defined $opt::colsep) ? "--colsep ".shell_quote($opt::colsep) : ""),
|
||||
((@opt::v) ? "-vv" : ""),
|
||||
((defined $opt::D) ? "-D" : ""),
|
||||
|
@ -247,8 +256,14 @@ if($opt::nonall or $opt::onall) {
|
|||
::debug("| $0 $options\n");
|
||||
open(my $parallel_fh, "|-", "$0 -j0 $options") ||
|
||||
::die_bug("This does not run GNU Parallel: $0 $options");
|
||||
my @joblogs;
|
||||
for my $sshlogin (values %Global::host) {
|
||||
print $parallel_fh "$0 $suboptions -j1 ".
|
||||
my $joblog = tmp_joblog($opt::joblog);
|
||||
if($joblog) {
|
||||
push @joblogs, $joblog;
|
||||
$joblog = "--joblog $joblog";
|
||||
}
|
||||
print $parallel_fh "$0 $suboptions -j1 $joblog ".
|
||||
((defined $opt::tag) ?
|
||||
"--tagstring ".shell_quote_scalar($sshlogin->string()) : "").
|
||||
" -S ". shell_quote_scalar($sshlogin->string())." ".
|
||||
|
@ -259,6 +274,16 @@ if($opt::nonall or $opt::onall) {
|
|||
debug("--onall exitvalue ",$?);
|
||||
if(@opt::basefile) { cleanup_basefile(); }
|
||||
unlink(@argfiles);
|
||||
my %seen;
|
||||
for my $joblog (@joblogs) {
|
||||
# Append to $joblog
|
||||
open(my $fh, "<", $joblog) || ::die_bug("Cannot open tmp joblog $joblog");
|
||||
# Skip first line (header);
|
||||
<$fh>;
|
||||
print $Global::joblog (<$fh>);
|
||||
close $fh;
|
||||
unlink($joblog);
|
||||
}
|
||||
wait_and_exit(min(undef_as_zero($Global::exitstatus),254));
|
||||
}
|
||||
|
||||
|
|
|
@ -1987,6 +1987,18 @@ can be written like this:
|
|||
B<parallel echo {1} {2} ::: M F ::: S M L XL XXL | sort>
|
||||
|
||||
|
||||
=head1 EXAMPLE: Finding the lowest difference between files
|
||||
|
||||
B<diff> is good for finding differences in text files. B<diff | wc -l>
|
||||
gives an indication of the size of the difference. To find the
|
||||
differences between all files in the current dir do:
|
||||
|
||||
B<parallel --tag 'diff {1} {2} | wc -l' ::: * ::: * | sort -nk3>
|
||||
|
||||
This way it is possible to see if some files are closer to other
|
||||
files.
|
||||
|
||||
|
||||
=head1 EXAMPLE: for-loops with column names
|
||||
|
||||
When doing multiple nested for-loops it can be easier to keep track of
|
||||
|
|
Loading…
Reference in a new issue