From 5fa7e57b6b14940eef8db085f02817343255861a Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Mon, 2 May 2022 22:38:23 +0200 Subject: [PATCH] parallel: Allow hostnames in UPPERCASE. --- src/parallel | 8 ++++---- testsuite/tests-to-run/parallel-local-ssh4.sh | 12 ++++++++++++ testsuite/tests-to-run/parallel-tutorial.sh | 2 +- testsuite/wanted-results/parallel-local-0.3s | 14 ++++++++------ testsuite/wanted-results/parallel-local-ssh4 | 19 +++++++++++++++++++ testsuite/wanted-results/parallel-tutorial | 4 ++-- 6 files changed, 46 insertions(+), 13 deletions(-) diff --git a/src/parallel b/src/parallel index e9ac1e60..2729c462 100755 --- a/src/parallel +++ b/src/parallel @@ -6784,10 +6784,10 @@ sub new($$) { } # [server]:port - if($s =~ s/([-a-z0-9.]+)//) { $host = $1; } + if($s =~ s/([-a-z0-9.]+)//i) { $host = $1; } # [:port] - if($s =~ s/:(\w+)//) { $port = $1; } + if($s =~ s/:(\w+)//i) { $port = $1; } if($s and $s ne ':') { ::die_bug("SSHLogin parser failed on '$origs' => '$s'"); @@ -11400,9 +11400,9 @@ sub print_joblog($) { 160..178,180,182..185,187..186,189,196..214,232..250, 253..254)); # reorder list so adjacent colors are dissimilar - # %7 and %17 were found experimentally + # %23 and %7 were found experimentally @color = @color[ - sort { ($b%7 <=> $a%7) or ($a%17 <=> $b%17) } 0..$#color + sort { ($a%23 <=> $b%23) or ($b%7 <=> $a%7) } 0..$#color ]; } my $self = shift; diff --git a/testsuite/tests-to-run/parallel-local-ssh4.sh b/testsuite/tests-to-run/parallel-local-ssh4.sh index fc204321..457c6334 100644 --- a/testsuite/tests-to-run/parallel-local-ssh4.sh +++ b/testsuite/tests-to-run/parallel-local-ssh4.sh @@ -9,6 +9,18 @@ unset run_once # SSH only allowed to localhost/lo +par_sshloginfile() { + echo '### --slf with mIxEd cAsE' + tmp=$(mktemp) + ( + echo 2/bash@LO + echo 3/parallel@Lo:22 + echo 4/ksh@lO:ssh + ) > "$tmp" + seq 9 | parallel --slf "$tmp" 'whoami;sleep 1;echo' | sort + rm -f "$tmp" +} + par_env_underscore() { echo '### --env _' echo ignored_var >> ~/.parallel/ignored_vars diff --git a/testsuite/tests-to-run/parallel-tutorial.sh b/testsuite/tests-to-run/parallel-tutorial.sh index 9f4df5d2..1ae5075e 100644 --- a/testsuite/tests-to-run/parallel-tutorial.sh +++ b/testsuite/tests-to-run/parallel-tutorial.sh @@ -78,7 +78,7 @@ perl -ne '$/="\n\n"; /^Output/../^[^O]\S/ and next; /^ / and print;' ../../src/ # Race condition s/^4-(middle|end)\n//; # Base 64 string with quotes - s:['"'"'"\\+/a-z0-9=]{50,}(\s['"'"'"\\+/a-z0-9=]*)*:BASE64:ig; + s:['"'"'"\\+/a-z.0-9=]{50,}(\s['"'"'"\\+/a-z.0-9=]*)*:BASE64:ig; # Timings are often off s/^(\d)$/9/; s/^(\d\d)$/99/; diff --git a/testsuite/wanted-results/parallel-local-0.3s b/testsuite/wanted-results/parallel-local-0.3s index ee55a5c5..2d08b98a 100644 --- a/testsuite/wanted-results/parallel-local-0.3s +++ b/testsuite/wanted-results/parallel-local-0.3s @@ -110,9 +110,11 @@ par_csv_pipe 9000" par_csv_pipe 11000" par_ctagstring ### --ctag --ctagstring should be different from --tag --tagstring par_ctagstring 8 -par_ctagstring 33 +par_ctagstring  +par_ctagstring 34 par_ctagstring 10 -par_ctagstring 35 +par_ctagstring  +par_ctagstring 36 par_delimiter ### Test --delimiter and -d: Delimiter instead of newline par_delimiter # Yes there is supposed to be an extra newline for -d N par_delimiter This is line 1 @@ -953,10 +955,10 @@ par_sem_quote ### sem --quote should not add empty argument par_sem_quote echo par_sem_quote par_shellcompletion ### --shellcompletion -par_shellcompletion f4aa0b2d61cf5e6836b738bf403c1d96 - -par_shellcompletion f4aa0b2d61cf5e6836b738bf403c1d96 - -par_shellcompletion be5b6ba646ba3f082315afd8e205c954 - -par_shellcompletion be5b6ba646ba3f082315afd8e205c954 - +par_shellcompletion 9c26e11f6435802cd18a8fd78f65f71d - +par_shellcompletion 9c26e11f6435802cd18a8fd78f65f71d - +par_shellcompletion 2b8f8856cd7b632edec5526f8d3637c9 - +par_shellcompletion 2b8f8856cd7b632edec5526f8d3637c9 - par_slow_pipe_regexp ### bug #53718: --pipe --regexp -N blocks par_slow_pipe_regexp This should take a few ms, but took more than 2 hours par_slow_pipe_regexp 0 1 1 diff --git a/testsuite/wanted-results/parallel-local-ssh4 b/testsuite/wanted-results/parallel-local-ssh4 index f3512133..6b3c2226 100644 --- a/testsuite/wanted-results/parallel-local-ssh4 +++ b/testsuite/wanted-results/parallel-local-ssh4 @@ -42,6 +42,25 @@ par_multiple_hosts_repeat_arg parallel: Warning: Using -X or -m with --sshlogin par_multiple_hosts_repeat_arg 1 par_multiple_hosts_repeat_arg 2 par_multiple_hosts_repeat_arg 3 +par_sshloginfile ### --slf with mIxEd cAsE +par_sshloginfile 1 +par_sshloginfile 2 +par_sshloginfile 3 +par_sshloginfile 4 +par_sshloginfile 5 +par_sshloginfile 6 +par_sshloginfile 7 +par_sshloginfile 8 +par_sshloginfile 9 +par_sshloginfile bash +par_sshloginfile bash +par_sshloginfile ksh +par_sshloginfile ksh +par_sshloginfile ksh +par_sshloginfile ksh +par_sshloginfile parallel +par_sshloginfile parallel +par_sshloginfile parallel par_tmux_different_shells ### Test tmux works on different shells par_tmux_different_shells 0 par_tmux_different_shells 4 diff --git a/testsuite/wanted-results/parallel-tutorial b/testsuite/wanted-results/parallel-tutorial index 967974f1..b9794a31 100644 --- a/testsuite/wanted-results/parallel-tutorial +++ b/testsuite/wanted-results/parallel-tutorial @@ -1272,7 +1272,7 @@ If you pay 10000 EUR you should feel free to use GNU Parallel without citing. More about funding GNU Parallel and the citation notice: https://lists.gnu.org/archive/html/parallel/2013-11/msg00006.html https://www.gnu.org/software/parallel/parallel_design.html#citation-notice -https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt +https:BASE64-notice-faq.txt If you send a copy of your published article to tange@gnu.org, it will be mentioned in the release notes of next version of GNU Parallel. parallel --number-of-cpus @@ -1286,4 +1286,4 @@ mentioned in the release notes of next version of GNU Parallel. echo A echo B echo C -8 +6