parallel: Bug fixes for --tollef compatibility.

This commit is contained in:
Ole Tange 2012-05-27 17:51:09 +02:00
parent 22b295cef1
commit 57538c384e
8 changed files with 54 additions and 32 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 20120522. # Generated by GNU Autoconf 2.68 for parallel 20120524.
# #
# 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='20120522' PACKAGE_VERSION='20120524'
PACKAGE_STRING='parallel 20120522' PACKAGE_STRING='parallel 20120524'
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 20120522 to adapt to many kinds of systems. \`configure' configures parallel 20120524 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 20120522:";; short | recursive ) echo "Configuration of parallel 20120524:";;
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 20120522 parallel configure 20120524
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 20120522, which was It was created by parallel $as_me 20120524, 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='20120522' VERSION='20120524'
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 20120522, which was This file was extended by parallel $as_me 20120524, 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 20120522 parallel config.status 20120524
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], [20120522], [bug-parallel@gnu.org]) AC_INIT([parallel], [20120524], [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 = 20120522; $Global::version = 20120524;
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

@ -499,7 +499,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20120523; $Global::version = 20120527;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -605,9 +605,27 @@ sub parse_options {
wait_and_exit(0); wait_and_exit(0);
} }
} }
if($::opt_tollef and not $::opt_gnu) {
# Behave like tollef parallel (from moreutils)
$::opt_u = 1;
$Global::grouped = 0;
$Global::quoting = 1;
$::opt_q = 1;
if(defined $::opt_l) {
$::opt_load = $::opt_l;
$::opt_l = undef;
}
if(not defined $::opt_arg_sep) {
$Global::arg_sep = "--";
}
if(not grep(/$Global::arg_sep/, @ARGV)) {
unshift(@ARGV, $ENV{SHELL}, "-c", "--");
}
}
if(defined $::opt_nonall) { if(defined $::opt_nonall) {
# Append a dummy empty argument # Append a dummy empty argument
push @ARGV, ":::", ""; push @ARGV, $Global::arg_sep, "";
} }
if(defined $::opt_tty) { if(defined $::opt_tty) {
# Defaults for --tty: -j1 -u # Defaults for --tty: -j1 -u
@ -624,16 +642,6 @@ sub parse_options {
$::opt_transfer = 1; $::opt_transfer = 1;
$::opt_cleanup = 1; $::opt_cleanup = 1;
} }
if($::opt_tollef and not $::opt_gnu) {
# Behave like tollef parallel (from moreutils)
if(defined $::opt_l) {
$::opt_load = $::opt_l;
$::opt_l = undef;
}
if(not defined $::opt_arg_sep) {
$Global::arg_sep = "--";
}
}
if(defined $::opt_l) { if(defined $::opt_l) {
if($::opt_l eq "-0") { if($::opt_l eq "-0") {
# -l -0 (swallowed -0) # -l -0 (swallowed -0)
@ -781,7 +789,7 @@ sub read_options {
$ARGV[0]=~s/^--hashbang *//; # remove --hashbang if it is set $ARGV[0]=~s/^--hashbang *//; # remove --hashbang if it is set
my $argfile = pop @ARGV; my $argfile = pop @ARGV;
# exec myself to split $ARGV[0] into separate fields # exec myself to split $ARGV[0] into separate fields
exec "$0 --skip-first-line -a $argfile @ARGV"; exec "tail -n +1 $argfile | $0 @ARGV";
} }
Getopt::Long::Configure("bundling","pass_through"); Getopt::Long::Configure("bundling","pass_through");

View file

@ -1226,8 +1226,15 @@ later, followed by SIGKILL 200 ms later.
=item B<--tollef> =item B<--tollef>
Make GNU B<parallel> behave like Tollef's parallel command. To Make GNU B<parallel> behave more like Tollef's parallel command. It
override use B<--gnu>. activates B<-u>, B<-q>, and B<--arg-sep -->. It also causes B<-l> to
change meaning to B<--load>.
Not giving '--' is unsupported.
B<Do not use --tollef unless you know what you are doing>.
To override use B<--gnu>.
=item B<--verbose> =item B<--verbose>

View file

@ -1306,8 +1306,15 @@ later, followed by SIGKILL 200 ms later.
@item @strong{--tollef} @item @strong{--tollef}
@anchor{@strong{--tollef}} @anchor{@strong{--tollef}}
Make GNU @strong{parallel} behave like Tollef's parallel command. To Make GNU @strong{parallel} behave more like Tollef's parallel command. It
override use @strong{--gnu}. activates @strong{-u}, @strong{-q}, and @strong{--arg-sep --}. It also causes @strong{-l} to
change meaning to @strong{--load}.
Not giving '--' is unsupported.
@strong{Do not use --tollef unless you know what you are doing}.
To override use @strong{--gnu}.
@item @strong{--verbose} @item @strong{--verbose}
@anchor{@strong{--verbose}} @anchor{@strong{--verbose}}

View file

@ -556,7 +556,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err); exit ($err);
sub parse_options { sub parse_options {
$Global::version = 20120522; $Global::version = 20120524;
$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

@ -45,7 +45,7 @@ portable:
sudo echo sudo echo
time bash Portable.sh time bash Portable.sh
timings: tests-to-run/* timings: tests-to-run/* ../src/parallel
ls tests-to-run/*.sh | xargs -n1 echo /usr/bin/time -f %e bash >/tmp/timing.script ls tests-to-run/*.sh | xargs -n1 echo /usr/bin/time -f %e bash >/tmp/timing.script
stdout bash -x /tmp/timing.script >/tmp/timing.out stdout bash -x /tmp/timing.script >/tmp/timing.out
echo usr.bin.time_END >>/tmp/timing.out echo usr.bin.time_END >>/tmp/timing.out