Fixed bug #62310: xargs compatibility: --open-tty

This commit is contained in:
Ole Tange 2022-04-26 01:05:44 +02:00
parent 8a918029ab
commit 8ab30be13a
5 changed files with 41 additions and 26 deletions

View file

@ -254,31 +254,26 @@ from:tange@gnu.org
to:parallel@gnu.org, bug-parallel@gnu.org
stable-bcc: Jesse Alama <jessealama@fastmail.fm>
Subject: GNU Parallel 20220422 ('Буча') released
Subject: GNU Parallel 20220522 ('Le Pen/Macron<<>>') released [stable]
GNU Parallel 20220422 ('Буча') has been released. It is available for download at: lbry://@GnuParallel:4
GNU Parallel 20220522 ('<<>>') has been released. It is available for download at: lbry://@GnuParallel:4
<<No new functionality was introduced so this is a good candidate for a stable release.>>
Quote of the month:
Immensely useful which I am forever grateful that it exists.
-- AlexDragusin@ycombinator
<<>>
New in this release:
* sash is no longer supported as shell.
* --retries 0 is an alias for --retries 2147483647.
* --shell-completion returns shell completion code.
* --ssh-login-file reloads every second.
* --parset is replaced with --_parset because it is only used internally.
* sem --pipe passes STDIN (standard input) to the command.
* <<>>
* Bug fixes and man page updates.
News about GNU Parallel:
<<>>
Get the book: GNU Parallel 2018 http://www.lulu.com/shop/ole-tange/gnu-parallel-2018/paperback/product-23558902.html
GNU Parallel - For people who live life in the parallel lane.

View file

@ -1853,6 +1853,7 @@ sub options_completion_hash() {
"[Use prg for decompressing temporary files]:prg:_commands"
=> \$opt::decompress_program),
"compress[Compress temporary files]" => \$opt::compress,
"open-tty|o[Open terminal tty]" => \$opt::open_tty,
"tty[Open terminal tty]" => \$opt::tty,
"T" => \$opt::retired,
"H=i" => \$opt::retired,
@ -2597,7 +2598,7 @@ sub check_invalid_option_combinations() {
sub init_globals() {
# Defaults:
$Global::version = 20220422;
$Global::version = 20220424;
$Global::progname = 'parallel';
$::name = "GNU Parallel";
$Global::infinity = 2**31;
@ -5552,7 +5553,7 @@ sub die_bug($) {
print STDERR
("$Global::progname: This should not happen. You have found a bug. ",
"Please follow\n",
"https://www.gnu.org/software/parallel/man.html#REPORTING-BUGS\n",
"https://www.gnu.org/software/parallel/man.html#reporting-bugs\n",
"\n",
"Include this in the report:\n",
"* The version number: $Global::version\n",
@ -10490,7 +10491,7 @@ sub start($) {
}
$job->set_fh(0,"w",$stdin_fh);
if($opt::tee or $opt::shard or $opt::bin) { $job->set_virgin(0); }
} elsif($opt::tty and -c "/dev/tty" and
} elsif(($opt::tty or $opt::open_tty) and -c "/dev/tty" and
open(my $devtty_fh, "<", "/dev/tty")) {
# Give /dev/tty to the command if no one else is using it
# The eval is needed to catch exception from open3

View file

@ -1778,6 +1778,17 @@ there will be several job sequence 1.
See also: B<--nonall> B<--sshlogin>
=item B<--open-tty> (alpha testing)
=item B<-o> (alpha testing)
Open terminal tty.
Similar to B<--tty> but does not set B<--jobs> or B<--ungroup>.
See also: B<--tty>
=item B<--output-as-files>
=item B<--outputasfiles>
@ -3132,7 +3143,7 @@ the jobs (with B<--timeout>, B<--memfree>, or B<--halt>). This is due
to GNU B<parallel> giving each child its own process group, which is
then killed. Process groups are dependant on the tty.
See also: B<--ungroup>
See also: B<--ungroup> B<--open-tty>
=item B<--tag>

View file

@ -16,6 +16,12 @@ export -f stdsort
# Test amount of parallelization
# parallel --shuf --jl /tmp/myjl -j1 'export JOBS={1};'bash tests-to-run/parallel-local-0.3s.sh ::: {1..16} ::: {1..5}
par_open-tty() {
echo '### bug #62310: xargs compatibility: --open-tty'
parallel --open-tty ::: tty
parallel -o ::: tty
}
par_shellcompletion() {
echo '### --shellcompletion'
# This will change, if you change options

View file

@ -535,6 +535,9 @@ par_no_command_given parallel: Error: Command line too long (1000002 >= 10) at i
par_no_joblog_with_dryrun bug #46016: --joblog should not log when --dryrun
par_no_joblog_with_dryrun echo Only_this
par_no_run_if_empty ### Test --no-run-if-empty and -r: This should give no output
par_open-tty ### bug #62310: xargs compatibility: --open-tty
par_open-tty /dev/tty
par_open-tty /dev/tty
par_opt_gnu ### Test --tollef
par_opt_gnu parallel: Error: --tollef has been retired.
par_opt_gnu parallel: Error: Remove --tollef or use --gnu to override --tollef.
@ -950,10 +953,10 @@ par_sem_quote ### sem --quote should not add empty argument
par_sem_quote echo
par_sem_quote
par_shellcompletion ### --shellcompletion
par_shellcompletion b0347a540d9fd8a81339b79577be4567 -
par_shellcompletion b0347a540d9fd8a81339b79577be4567 -
par_shellcompletion 5b279fc707895c822a66e84b32b47195 -
par_shellcompletion 5b279fc707895c822a66e84b32b47195 -
par_shellcompletion 920d653deec2b96528d7dcfe396f771f -
par_shellcompletion 920d653deec2b96528d7dcfe396f771f -
par_shellcompletion 5a53f2595ceeefbf3fb70d0cae4af71c -
par_shellcompletion 5a53f2595ceeefbf3fb70d0cae4af71c -
par_slow_pipe_regexp ### bug #53718: --pipe --regexp -N blocks
par_slow_pipe_regexp This should take a few ms, but took more than 2 hours
par_slow_pipe_regexp 0 1 1
@ -1068,8 +1071,7 @@ par_testquote rc "#&/
par_testquote rc ()*=?'
par_testquote rzsh "#&/
par_testquote rzsh ()*=?'
par_testquote sash "#&/
par_testquote sash ()*=?'
par_testquote sash -f parallel: Error: Shell 'sash -f' not found.
par_testquote sh "#&/
par_testquote sh ()*=?'
par_testquote static-sh "#&/