From 457320998f6c71fa7ac885d90265cf227874d3b3 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Fri, 20 Apr 2012 20:49:40 +0200 Subject: [PATCH] Fixed: bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty --- configure | 20 ++++++++++---------- configure.ac | 2 +- src/niceload | 2 +- src/parallel | 6 +++--- src/sql | 2 +- testsuite/tests-to-run/test30.sh | 3 +++ testsuite/wanted-results/test30 | 4 ++++ 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 2f4e0cc2..18e49c63 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for parallel 20120322. +# Generated by GNU Autoconf 2.68 for parallel 20120411. # # Report bugs to . # @@ -559,8 +559,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='parallel' PACKAGE_TARNAME='parallel' -PACKAGE_VERSION='20120322' -PACKAGE_STRING='parallel 20120322' +PACKAGE_VERSION='20120411' +PACKAGE_STRING='parallel 20120411' PACKAGE_BUGREPORT='bug-parallel@gnu.org' PACKAGE_URL='' @@ -1176,7 +1176,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures parallel 20120322 to adapt to many kinds of systems. +\`configure' configures parallel 20120411 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1242,7 +1242,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of parallel 20120322:";; + short | recursive ) echo "Configuration of parallel 20120411:";; esac cat <<\_ACEOF @@ -1309,7 +1309,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -parallel configure 20120322 +parallel configure 20120411 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1326,7 +1326,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by parallel $as_me 20120322, which was +It was created by parallel $as_me 20120411, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2141,7 +2141,7 @@ fi # Define the identity of the package. PACKAGE='parallel' - VERSION='20120322' + VERSION='20120411' cat >>confdefs.h <<_ACEOF @@ -2704,7 +2704,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by parallel $as_me 20120322, which was +This file was extended by parallel $as_me 20120411, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2766,7 +2766,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -parallel config.status 20120322 +parallel config.status 20120411 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 2651180b..a304aff0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([parallel], [20120322], [bug-parallel@gnu.org]) +AC_INIT([parallel], [20120411], [bug-parallel@gnu.org]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ diff --git a/src/niceload b/src/niceload index c974de5a..67c00503 100755 --- a/src/niceload +++ b/src/niceload @@ -24,7 +24,7 @@ use strict; use Getopt::Long; $Global::progname="niceload"; -$Global::version = 20120322; +$Global::version = 20120411; Getopt::Long::Configure("bundling","require_order"); get_options_from_array(\@ARGV) || die_usage(); if($::opt_version) { diff --git a/src/parallel b/src/parallel index 81d01fd6..d50a8523 100755 --- a/src/parallel +++ b/src/parallel @@ -411,7 +411,7 @@ sub options_hash { "joblog=s" => \$::opt_joblog, "resume" => \$::opt_resume, "silent" => \$::opt_silent, - "silent-error|silenterror" => \$::opt_silent_error, + #"silent-error|silenterror" => \$::opt_silent_error, "keep-order|keeporder|k" => \$::opt_k, "group" => \$::opt_group, "g" => \$::opt_retired, @@ -537,7 +537,7 @@ sub get_options_from_array { sub parse_options { # Returns: N/A # Defaults: - $Global::version = 20120410; + $Global::version = 20120420; $Global::progname = 'parallel'; $Global::infinity = 2**31; $Global::debug = 0; @@ -4585,7 +4585,7 @@ sub get { my $line = $arg->orig(); ::debug("line='$line'\n"); if($line ne "") { - for my $s (split /$::opt_colsep/o, $line) { + for my $s (split /$::opt_colsep/o, $line, -1) { push @out_record, Arg->new($s); } } else { diff --git a/src/sql b/src/sql index db5f65f8..54e794d7 100755 --- a/src/sql +++ b/src/sql @@ -556,7 +556,7 @@ $Global::Initfile && unlink $Global::Initfile; exit ($err); sub parse_options { - $Global::version = 20120322; + $Global::version = 20120411; $Global::progname = 'sql'; # This must be done first as this may exec myself diff --git a/testsuite/tests-to-run/test30.sh b/testsuite/tests-to-run/test30.sh index c6ecb48e..c83419d9 100644 --- a/testsuite/tests-to-run/test30.sh +++ b/testsuite/tests-to-run/test30.sh @@ -22,4 +22,7 @@ parallel -j0 --timeout 4 --onall -S localhost,parallel@parallel-server1 'sleep { echo '### --pipe without command' seq -w 10 | stdout parallel --pipe + +echo '### bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty' +echo A,B,, | parallel --colsep , echo {1}{3}{2} EOF diff --git a/testsuite/wanted-results/test30 b/testsuite/wanted-results/test30 index ff8fc995..fb7b1a2c 100644 --- a/testsuite/wanted-results/test30 +++ b/testsuite/wanted-results/test30 @@ -18,9 +18,13 @@ Computers / CPU cores / Max jobs to run Computers / CPU cores / Max jobs to run 1:local / 2 / 1 +Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete + local:1/0/100%/0.0s ### --timeout on remote machines slept 1 slept 1 jobs failed: 2 ### --pipe without command parallel: --pipe must have a command to pipe into (e.g. 'cat') +### bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty +AB