247 lines
9.1 KiB
Diff
247 lines
9.1 KiB
Diff
From 053a577963192e699bcbe715672d15d84f46e8dd Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
|
|
Date: Fri, 22 Mar 2019 19:04:42 +0100
|
|
Subject: [PATCH 2/2] Remove GNU branding
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
To comply with trademark requirements.
|
|
|
|
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
|
|
---
|
|
src/parallel | 62 ++++++++++++++++++++++++++--------------------------
|
|
1 file changed, 31 insertions(+), 31 deletions(-)
|
|
|
|
diff --git a/src/parallel b/src/parallel
|
|
index e8ae7b0..502cebb 100755
|
|
--- a/src/parallel
|
|
+++ b/src/parallel
|
|
@@ -1758,7 +1758,7 @@ sub parse_options(@) {
|
|
if(defined $opt::tmpdir) { $ENV{'TMPDIR'} = $opt::tmpdir; }
|
|
$ENV{'PARALLEL_RSYNC_OPTS'} = $opt::rsync_opts ||
|
|
$ENV{'PARALLEL_RSYNC_OPTS'} || '-rlDzR';
|
|
- # Default: Same nice level as GNU Parallel is started at
|
|
+ # Default: Same nice level as Parallel is started at
|
|
$opt::nice ||= eval { getpriority(0,0) } || 0;
|
|
if(defined $opt::help) { usage(); exit(0); }
|
|
if(defined $opt::embed) { embed(); exit(0); }
|
|
@@ -2066,7 +2066,7 @@ sub init_globals() {
|
|
# Defaults:
|
|
$Global::version = 20200322;
|
|
$Global::progname = 'parallel';
|
|
- $::name = "GNU Parallel";
|
|
+ $::name = "Parallel";
|
|
$Global::infinity = 2**31;
|
|
$Global::debug = 0;
|
|
$Global::verbose = 0;
|
|
@@ -2281,7 +2281,7 @@ sub parse_replacement_string_options() {
|
|
sub parse_semaphore() {
|
|
# Semaphore defaults
|
|
# Must be done before computing number of processes and max_line_length
|
|
- # because when running as a semaphore GNU Parallel does not read args
|
|
+ # because when running as a semaphore Parallel does not read args
|
|
# Uses:
|
|
# $opt::semaphore
|
|
# $Global::semaphore
|
|
@@ -3110,7 +3110,7 @@ sub __RUNNING_THE_JOBS_AND_PRINTING_PROGRESS__() {}
|
|
# $Global::total_started = total number of jobs started
|
|
# $Global::joblog = filehandle of joblog
|
|
# $Global::debug = Is debugging on?
|
|
-# $Global::exitstatus = status code of GNU Parallel
|
|
+# $Global::exitstatus = status code of Parallel
|
|
# $Global::quoting = quote the command to run
|
|
|
|
sub init_run_jobs() {
|
|
@@ -4019,7 +4019,7 @@ sub setup_basefile() {
|
|
}
|
|
debug("init", "basesetup: @cmd\n");
|
|
my ($exitstatus,$stdout_ref,$stderr_ref) =
|
|
- run_gnu_parallel((join "\n",@cmd),"-j0","--retries",5);
|
|
+ run_parallel((join "\n",@cmd),"-j0","--retries",5);
|
|
if($exitstatus) {
|
|
my @stdout = @$stdout_ref;
|
|
my @stderr = @$stderr_ref;
|
|
@@ -4049,7 +4049,7 @@ sub cleanup_basefile() {
|
|
}
|
|
debug("init", "basecleanup: @cmd\n");
|
|
my ($exitstatus,$stdout_ref,$stderr_ref) =
|
|
- run_gnu_parallel(join("\n",@cmd),"-j0","--retries",5);
|
|
+ run_parallel(join("\n",@cmd),"-j0","--retries",5);
|
|
if($exitstatus) {
|
|
my @stdout = @$stdout_ref;
|
|
my @stderr = @$stderr_ref;
|
|
@@ -4058,22 +4058,22 @@ sub cleanup_basefile() {
|
|
}
|
|
}
|
|
|
|
-sub run_gnu_parallel() {
|
|
+sub run_parallel() {
|
|
my ($stdin,@args) = @_;
|
|
my $cmd = join "",map { " $_ & " } split /\n/, $stdin;
|
|
print $Global::original_stderr ` $cmd wait` ;
|
|
return 0
|
|
}
|
|
|
|
-sub _run_gnu_parallel() {
|
|
- # Run GNU Parallel
|
|
+sub _run_parallel() {
|
|
+ # Run Parallel
|
|
# This should ideally just fork an internal copy
|
|
# and not start it through a shell
|
|
# Input:
|
|
- # $stdin = data to provide on stdin for GNU Parallel
|
|
+ # $stdin = data to provide on stdin for Parallel
|
|
# @args = command line arguments
|
|
# Returns:
|
|
- # $exitstatus = exitcode of GNU Parallel run
|
|
+ # $exitstatus = exitcode of Parallel run
|
|
# \@stdout = standard output
|
|
# \@stderr = standard error
|
|
my ($stdin,@args) = @_;
|
|
@@ -4449,7 +4449,7 @@ sub onall($@) {
|
|
);
|
|
::debug("init", "| $0 $options\n");
|
|
open(my $parallel_fh, "|-", "$0 -0 --will-cite -j0 $options") ||
|
|
- ::die_bug("This does not run GNU Parallel: $0 $options");
|
|
+ ::die_bug("This does not run Parallel: $0 $options");
|
|
my @joblogs;
|
|
for my $host (sort keys %Global::host) {
|
|
my $sshlogin = $Global::host{$host};
|
|
@@ -4513,14 +4513,14 @@ sub sigpipe() {
|
|
|
|
sub signal_children() {
|
|
# Send signal to all children process groups
|
|
- # and GNU Parallel itself
|
|
+ # and Parallel itself
|
|
# Uses:
|
|
# %SIG
|
|
# Returns: N/A
|
|
my $signal = shift;
|
|
debug("run", "Sending $signal ");
|
|
kill $signal, map { -$_ } keys %Global::running;
|
|
- # Use default signal handler for GNU Parallel itself
|
|
+ # Use default signal handler for Parallel itself
|
|
$SIG{$signal} = undef;
|
|
kill $signal, $$;
|
|
}
|
|
@@ -4842,12 +4842,12 @@ sub version() {
|
|
# Returns: N/A
|
|
print join
|
|
("\n",
|
|
- "GNU $Global::progname $Global::version",
|
|
+ "$Global::progname $Global::version",
|
|
"Copyright (C) 2007-2020 Ole Tange, http://ole.tange.dk and Free Software",
|
|
"Foundation, Inc.",
|
|
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>",
|
|
"This is free software: you are free to change and redistribute it.",
|
|
- "GNU $Global::progname comes with no warranty.\n",
|
|
+ "$Global::progname comes with no warranty.\n",
|
|
);
|
|
}
|
|
|
|
@@ -4862,7 +4862,7 @@ sub show_limits() {
|
|
}
|
|
|
|
sub embed() {
|
|
- # Give an embeddable version of GNU Parallel
|
|
+ # Give an embeddable version of Parallel
|
|
# Tested with: bash, zsh, ksh, ash, dash, sh
|
|
my $randomstring = "cut-here-".join"",
|
|
map { (0..9,"a".."z","A".."Z")[rand(62)] } (1..20);
|
|
@@ -4907,9 +4907,9 @@ sub embed() {
|
|
";
|
|
|
|
print q!
|
|
-# Embedded GNU Parallel created with --embed
|
|
+# Embedded Parallel created with --embed
|
|
parallel() {
|
|
- # Start GNU Parallel without leaving temporary files
|
|
+ # Start Parallel without leaving temporary files
|
|
#
|
|
# Not all shells support 'perl <(cat ...)'
|
|
# This is a complex way of doing:
|
|
@@ -4920,7 +4920,7 @@ parallel() {
|
|
# [1]+ Done cat
|
|
|
|
# Make a temporary fifo that perl can read from
|
|
- _fifo_with_GNU_Parallel_source=`perl -e 'use POSIX qw(mkfifo);
|
|
+ _fifo_with_Parallel_source=`perl -e 'use POSIX qw(mkfifo);
|
|
do {
|
|
$f = "/tmp/parallel-".join"",
|
|
map { (0..9,"a".."z","A".."Z")[rand(62)] } (1..5);
|
|
@@ -4929,9 +4929,9 @@ parallel() {
|
|
print $f;'`
|
|
# Put source code into temporary file
|
|
# so it is easy to copy to the fifo
|
|
- _file_with_GNU_Parallel_source=`mktemp`;
|
|
+ _file_with_Parallel_source=`mktemp`;
|
|
!,
|
|
- "cat <<'$randomstring' > \$_file_with_GNU_Parallel_source\n",
|
|
+ "cat <<'$randomstring' > \$_file_with_Parallel_source\n",
|
|
@source,
|
|
$randomstring,"\n",
|
|
q!
|
|
@@ -4939,10 +4939,10 @@ parallel() {
|
|
# and remove the file and fifo ASAP
|
|
# 'sh -c' is needed to avoid
|
|
# [1]+ Done cat
|
|
- sh -c "(rm $_file_with_GNU_Parallel_source; cat >$_fifo_with_GNU_Parallel_source; rm $_fifo_with_GNU_Parallel_source) < $_file_with_GNU_Parallel_source &"
|
|
+ sh -c "(rm $_file_with_Parallel_source; cat >$_fifo_with_Parallel_source; rm $_fifo_with_Parallel_source) < $_file_with_Parallel_source &"
|
|
|
|
# Read the source from the fifo
|
|
- perl $_fifo_with_GNU_Parallel_source "$@"
|
|
+ perl $_fifo_with_Parallel_source "$@"
|
|
}
|
|
!,
|
|
@env_parallel_source,
|
|
@@ -6384,7 +6384,7 @@ sub loadavg($) {
|
|
# Recompute a new one in the background
|
|
# The load average is computed as the number of processes waiting for disk
|
|
# or CPU right now. So it is the server load this instant and not averaged over
|
|
- # several minutes. This is needed so GNU Parallel will at most start one job
|
|
+ # several minutes. This is needed so Parallel will at most start one job
|
|
# that will push the load over the limit.
|
|
#
|
|
# Returns:
|
|
@@ -8552,8 +8552,8 @@ sub base64_zip_eval() {
|
|
# Returns:
|
|
# $script = 1-liner for perl -e
|
|
my $script = ::spacefree(0,q{
|
|
- @GNU_Parallel = split /_/, "use_IPC::Open3;_use_MIME::Base64";
|
|
- eval"@GNU_Parallel";
|
|
+ @Parallel = split /_/, "use_IPC::Open3;_use_MIME::Base64";
|
|
+ eval"@Parallel";
|
|
$chld = $SIG{CHLD};
|
|
$SIG{CHLD} = "IGNORE";
|
|
# Search for bzip2. Not found => use default path
|
|
@@ -8605,13 +8605,13 @@ sub base64_eval($) {
|
|
# Will be wrapped in ' so single quote is forbidden.
|
|
# Spaces are stripped so spaces cannot be significant.
|
|
# The funny 'use IPC::Open3'-syntax is to avoid spaces and
|
|
- # to make it clear that this is a GNU Parallel command
|
|
+ # to make it clear that this is a Parallel command
|
|
# when looking at the process table.
|
|
# Returns:
|
|
# $script = 1-liner for perl -e
|
|
my $script = ::spacefree(0,q{
|
|
- @GNU_Parallel=("use","IPC::Open3;","use","MIME::Base64");
|
|
- eval "@GNU_Parallel";
|
|
+ @Parallel=("use","IPC::Open3;","use","MIME::Base64");
|
|
+ eval "@Parallel";
|
|
my $eval = decode_base64(join"",@ARGV);
|
|
eval $eval;
|
|
});
|
|
@@ -11285,7 +11285,7 @@ sub get($) {
|
|
my $ret = $self->{'arg_sub_queue'}->get();
|
|
if($ret) {
|
|
if(grep { index($_->orig(),"\0") > 0 } @$ret) {
|
|
- # Allow for \0 in position 0 because GNU Parallel uses "\0noarg"
|
|
+ # Allow for \0 in position 0 because Parallel uses "\0noarg"
|
|
# to mean no-string
|
|
::warning("A NUL character in the input was replaced with \\0.",
|
|
"NUL cannot be passed through in the argument list.",
|
|
--
|
|
2.26.2
|
|
|