Fixed: bug #36260: {n} expansion in --colsep files fails for empty fields if all following fields are also empty

This commit is contained in:
Ole Tange 2012-04-20 20:49:40 +02:00
parent a772df5872
commit 457320998f
7 changed files with 23 additions and 16 deletions

20
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # 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 <bug-parallel@gnu.org>. # Report bugs to <bug-parallel@gnu.org>.
# #
@ -559,8 +559,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='parallel' PACKAGE_NAME='parallel'
PACKAGE_TARNAME='parallel' PACKAGE_TARNAME='parallel'
PACKAGE_VERSION='20120322' PACKAGE_VERSION='20120411'
PACKAGE_STRING='parallel 20120322' PACKAGE_STRING='parallel 20120411'
PACKAGE_BUGREPORT='bug-parallel@gnu.org' PACKAGE_BUGREPORT='bug-parallel@gnu.org'
PACKAGE_URL='' 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. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF 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]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1242,7 +1242,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of parallel 20120322:";; short | recursive ) echo "Configuration of parallel 20120411:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1309,7 +1309,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
parallel configure 20120322 parallel configure 20120411
generated by GNU Autoconf 2.68 generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc. Copyright (C) 2010 Free Software Foundation, Inc.
@ -1326,7 +1326,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. 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 generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@ $ $0 $@
@ -2141,7 +2141,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='parallel' PACKAGE='parallel'
VERSION='20120322' VERSION='20120411'
cat >>confdefs.h <<_ACEOF 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 # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" 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 generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -2766,7 +2766,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
parallel config.status 20120322 parallel config.status 20120411
configured by $0, generated by GNU Autoconf 2.68, configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View file

@ -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]) AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([ AC_CONFIG_FILES([

View file

@ -24,7 +24,7 @@
use strict; use strict;
use Getopt::Long; use Getopt::Long;
$Global::progname="niceload"; $Global::progname="niceload";
$Global::version = 20120322; $Global::version = 20120411;
Getopt::Long::Configure("bundling","require_order"); Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage(); get_options_from_array(\@ARGV) || die_usage();
if($::opt_version) { if($::opt_version) {

View file

@ -411,7 +411,7 @@ sub options_hash {
"joblog=s" => \$::opt_joblog, "joblog=s" => \$::opt_joblog,
"resume" => \$::opt_resume, "resume" => \$::opt_resume,
"silent" => \$::opt_silent, "silent" => \$::opt_silent,
"silent-error|silenterror" => \$::opt_silent_error, #"silent-error|silenterror" => \$::opt_silent_error,
"keep-order|keeporder|k" => \$::opt_k, "keep-order|keeporder|k" => \$::opt_k,
"group" => \$::opt_group, "group" => \$::opt_group,
"g" => \$::opt_retired, "g" => \$::opt_retired,
@ -537,7 +537,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20120410; $Global::version = 20120420;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -4585,7 +4585,7 @@ sub get {
my $line = $arg->orig(); my $line = $arg->orig();
::debug("line='$line'\n"); ::debug("line='$line'\n");
if($line ne "") { 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); push @out_record, Arg->new($s);
} }
} else { } else {

View file

@ -556,7 +556,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err); exit ($err);
sub parse_options { sub parse_options {
$Global::version = 20120322; $Global::version = 20120411;
$Global::progname = 'sql'; $Global::progname = 'sql';
# This must be done first as this may exec myself # This must be done first as this may exec myself

View file

@ -22,4 +22,7 @@ parallel -j0 --timeout 4 --onall -S localhost,parallel@parallel-server1 'sleep {
echo '### --pipe without command' echo '### --pipe without command'
seq -w 10 | stdout parallel --pipe 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 EOF

View file

@ -18,9 +18,13 @@ Computers / CPU cores / Max jobs to run
Computers / CPU cores / Max jobs to run Computers / CPU cores / Max jobs to run
1:local / 2 / 1 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 ### --timeout on remote machines
slept 1 slept 1
slept 1 slept 1
jobs failed: 2 jobs failed: 2
### --pipe without command ### --pipe without command
parallel: --pipe must have a command to pipe into (e.g. 'cat') 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