From 828843fa1528942ec18e5aab29cd766c0b41db3e Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 24 Mar 2013 19:36:56 +0100 Subject: [PATCH] testsuite: --env test now much faster. parallel: Small code cleanup. --- src/parallel | 18 ++++++++++-------- src/parallel.texi | 11 ++++++++--- testsuite/tests-to-run/parallel-local16.sh | 5 ----- testsuite/tests-to-run/parallel-local17.sh | 5 ----- testsuite/wanted-results/parallel-local17 | 1 - .../{parallel-local16 => parallel-localhost1} | 0 6 files changed, 18 insertions(+), 22 deletions(-) delete mode 100755 testsuite/tests-to-run/parallel-local16.sh delete mode 100755 testsuite/tests-to-run/parallel-local17.sh delete mode 100644 testsuite/wanted-results/parallel-local17 rename testsuite/wanted-results/{parallel-local16 => parallel-localhost1} (100%) diff --git a/src/parallel b/src/parallel index 71931d28..7ea86e62 100755 --- a/src/parallel +++ b/src/parallel @@ -199,6 +199,7 @@ if($opt::nonall or $opt::onall) { ((defined $opt::group) ? "-g" : ""), ((defined $opt::D) ? "-D" : ""), ((defined $opt::plain) ? "--plain" : ""), + ((defined $opt::max_chars) ? "--max-chars ".$opt::max_chars : ""), ); my $suboptions = join(" ", @@ -211,6 +212,7 @@ if($opt::nonall or $opt::onall) { ((defined $opt::timeout) ? "--timeout ".$opt::timeout : ""), ((defined $opt::plain) ? "--plain" : ""), ((defined $opt::retries) ? "--retries ".$opt::retries : ""), + ((defined $opt::max_chars) ? "--max-chars ".$opt::max_chars : ""), (@opt::env ? map { "--env ".::shell_quote_scalar($_) } @opt::env : ""), ); ::debug("| $0 $options\n"); @@ -578,7 +580,7 @@ sub options_hash { # xargs-compatibility - implemented, man, testsuite "max-procs|P=s" => \$opt::P, "delimiter|d=s" => \$opt::d, - "max-chars|s=i" => \$opt::s, + "max-chars|s=i" => \$opt::max_chars, "arg-file|a=s" => \@opt::a, "no-run-if-empty|r" => \$opt::r, "replace|i:s" => \$opt::i, @@ -4118,7 +4120,7 @@ sub print { # Verbose level > 1: Print the rsync and stuff $cmd = $command; } - printf $Global::joblog + print $Global::joblog join("\t", $self->seq(), $self->sshlogin()->string(), $self->starttime(), $self->runtime(), $self->transfersize(), $self->returnsize(), @@ -4917,15 +4919,15 @@ sub max_length { # Returns: # number of chars on the longest command line allowed if(not $Limits::Command::line_max_len) { - if($opt::s) { - if(is_acceptable_command_line_length($opt::s)) { - $Limits::Command::line_max_len = $opt::s; + if($opt::max_chars) { + if(is_acceptable_command_line_length($opt::max_chars)) { + $Limits::Command::line_max_len = $opt::max_chars; } else { # -s is too long: Find the correct - $Limits::Command::line_max_len = binary_find_max_length(0,$opt::s); + $Limits::Command::line_max_len = binary_find_max_length(0,$opt::max_chars); } - if($opt::s <= $Limits::Command::line_max_len) { - $Limits::Command::line_max_len = $opt::s; + if($opt::max_chars <= $Limits::Command::line_max_len) { + $Limits::Command::line_max_len = $opt::max_chars; } else { ::warning("Value for -s option ", "should be < $Limits::Command::line_max_len.\n"); diff --git a/src/parallel.texi b/src/parallel.texi index 24527930..844f6be8 100644 --- a/src/parallel.texi +++ b/src/parallel.texi @@ -2412,7 +2412,7 @@ files over high speed connections. The following will start one @strong{rsync} per big file in @emph{src-dir} to @emph{dest-dir} on the server @emph{fooserver}: -@strong{find src-dir -type f -size +100000 | parallel -v ssh fooserver +@strong{cd src-dir; find . -type f -size +100000 | parallel -v ssh fooserver mkdir -p /dest-dir/@{//@}\;rsync -Havessh @{@} fooserver:/dest-dir/@{@}} The dirs created may end up with wrong permissions and smaller files @@ -2420,6 +2420,11 @@ are not being transferred. To fix those run @strong{rsync} a final time: @strong{rsync -Havessh src-dir/ fooserver:/dest-dir/} +If you are unable to push data, but need to pull them and the files +are called digits.png (e.g. 000000.png) you might be able to do: + + + @chapter EXAMPLE: Use multiple inputs in one command @anchor{EXAMPLE: Use multiple inputs in one command} @@ -3694,10 +3699,10 @@ released version you should specify why you believe the problem is not fixed in that version. @item A complete example that others can run that shows the problem. This -should preferably be small and simple. A combination of @strong{seq}, +should preferably be small and simple. A combination of @strong{yes}, @strong{seq}, @strong{cat}, @strong{echo}, and @strong{sleep} can reproduce most errors. If your example requires large files, see if you can make them by something -like @strong{seq 1000000} > @strong{file}. +like @strong{seq 1000000} > @strong{file} or @strong{yes | head -n 10000000} > @strong{file}. @item The output of your example. If your problem is not easily reproduced by others, the output might help them figure out the problem. diff --git a/testsuite/tests-to-run/parallel-local16.sh b/testsuite/tests-to-run/parallel-local16.sh deleted file mode 100755 index aef5ee12..00000000 --- a/testsuite/tests-to-run/parallel-local16.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo '### Test --env all chars except \n,\92,\160 - single and double - no output is good' -# 92 and 160 are special for csh -perl -e 'for(1..9,9,11..91,91,93..159,159,161..255) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 10 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel --retries 3 -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --env V,V2 echo \''"{}$V$V2"'\' ::: {#} {#} {#} {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11 diff --git a/testsuite/tests-to-run/parallel-local17.sh b/testsuite/tests-to-run/parallel-local17.sh deleted file mode 100755 index 3303f587..00000000 --- a/testsuite/tests-to-run/parallel-local17.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -echo '### Test --env all chars except \n,\92,\160 - single and double --onall - no output is good' -# 92 and 160 are special for csh -perl -e 'for(1..9,9,11..91,91,93..159,159,161..255) { printf "%c%c %c%d\0",$_,$_,$_,$_ }' | stdout parallel --nice 10 -j4 -k -I // --arg-sep _ -0 V=// V2=V2=// parallel --retries 5 -k -j1 -S :,1/lo,1/tcsh@lo,1/csh@lo --onall --env V,V2 echo \''"{}$V$V2"'\' ::: {#} | uniq -c | grep -v ' 4 '|grep -v xauth |grep -v X11 diff --git a/testsuite/wanted-results/parallel-local17 b/testsuite/wanted-results/parallel-local17 deleted file mode 100644 index a7db8a2e..00000000 --- a/testsuite/wanted-results/parallel-local17 +++ /dev/null @@ -1 +0,0 @@ -### Test --env all chars except \n,\92,\160 - single and double --onall - no output is good diff --git a/testsuite/wanted-results/parallel-local16 b/testsuite/wanted-results/parallel-localhost1 similarity index 100% rename from testsuite/wanted-results/parallel-local16 rename to testsuite/wanted-results/parallel-localhost1