From 1cf521971f652ba00800e9452af7c5913c8e6b30 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Tue, 15 Jul 2014 18:02:58 +0200 Subject: [PATCH] Fixed bug #42055: --pipe -a bigfile should not require sequential reading of bigfile. --- src/parallel | 9 ++++++++- src/parallel.pod | 2 +- src/parallel_tutorial.1 | 2 +- testsuite/tests-to-run/parallel-local22.sh | 7 ++++++- testsuite/wanted-results/parallel-local22 | 9 ++++++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/parallel b/src/parallel index 6864d95e..128e0635 100755 --- a/src/parallel +++ b/src/parallel @@ -680,7 +680,7 @@ sub options_hash { "header=s" => \$opt::header, "cat" => \$opt::cat, "fifo" => \$opt::fifo, - "pipepart" => \$opt::pipepart, + "pipepart|pipe-part" => \$opt::pipepart, ); } @@ -915,6 +915,13 @@ sub parse_options { if(defined $opt::tag and not defined $opt::tagstring) { $opt::tagstring = "\257<\257>"; # Default = {} } + if(defined $opt::pipepart and + (defined $opt::L or defined $opt::max_lines + or defined $opt::max_replace_args)) { + ::error("--pipepart is incompatible with --max-replace-args, ", + "--max-lines, and -L.\n"); + wait_and_exit(255); + } if(grep /^$Global::arg_sep$|^$Global::arg_file_sep$/o, @ARGV) { # Deal with ::: and :::: @ARGV=read_args_from_command_line(); diff --git a/src/parallel.pod b/src/parallel.pod index e0449727..3ebf2cdc 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -970,7 +970,7 @@ The file must be a physical (seekable) file and must be given using B<-a> or B<: =item Z<>* -Record counting (B<-N>) and line counting (B<-L>) do not work. +Record counting (B<-N>) and line counting (B<-L>/B<-l>) do not work. =back diff --git a/src/parallel_tutorial.1 b/src/parallel_tutorial.1 index 4a0fdd27..18586d95 100644 --- a/src/parallel_tutorial.1 +++ b/src/parallel_tutorial.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "PARALLEL_TUTORIAL 1" -.TH PARALLEL_TUTORIAL 1 "2014-06-22" "20140613" "parallel" +.TH PARALLEL_TUTORIAL 1 "2014-07-15" "20140711" "parallel" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/testsuite/tests-to-run/parallel-local22.sh b/testsuite/tests-to-run/parallel-local22.sh index abeaefd8..5cc8d3c2 100755 --- a/testsuite/tests-to-run/parallel-local22.sh +++ b/testsuite/tests-to-run/parallel-local22.sh @@ -49,7 +49,12 @@ echo '### bug #42041: Implement $PARALLEL_JOBSLOT' echo '### bug #42363: --pipepart and --fifo/--cat does not work' seq 100 > /tmp/bug42363; - parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; + parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; +echo '### bug #42055: --pipe -a bigfile should not require sequential reading of bigfile' + parallel --pipepart -a /etc/passwd -L 1 should not be run + parallel --pipepart -a /etc/passwd -N 1 should not be run + parallel --pipepart -a /etc/passwd -l 1 should not be run + EOF diff --git a/testsuite/wanted-results/parallel-local22 b/testsuite/wanted-results/parallel-local22 index cf9b30f5..7448e7a2 100644 --- a/testsuite/wanted-results/parallel-local22 +++ b/testsuite/wanted-results/parallel-local22 @@ -47,7 +47,7 @@ echo '### bug #42041: Implement $PARALLEL_JOBSLOT' 2 echo '### bug #42363: --pipepart and --fifo/--cat does not work' ### bug #42363: --pipepart and --fifo/--cat does not work - seq 100 > /tmp/bug42363; parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; + seq 100 > /tmp/bug42363; parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe s:/tmp/...........pip:/tmp/XXXX: ; echo '### bug #42055: --pipe -a bigfile should not require sequential reading of bigfile' 13 14 32 /tmp/XXXX 11 11 33 /tmp/XXXX 11 11 33 /tmp/XXXX @@ -66,3 +66,10 @@ echo '### bug #42363: --pipepart and --fifo/--cat does not work' 11 11 33 /tmp/XXXX 11 11 33 /tmp/XXXX 10 9 29 /tmp/XXXX +### bug #42055: --pipe -a bigfile should not require sequential reading of bigfile + parallel --pipepart -a /etc/passwd -L 1 should not be run +parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines, and -L. + parallel --pipepart -a /etc/passwd -N 1 should not be run +parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines, and -L. + parallel --pipepart -a /etc/passwd -l 1 should not be run +parallel: Error: --pipepart is incompatible with --max-replace-args, --max-lines, and -L.