Fixed bug #58027: If .parallel/tmp missing on CygWin...

This commit is contained in:
Ole Tange 2020-03-23 16:35:37 +01:00
parent 36912dc230
commit 0c21f74a00

View file

@ -1968,8 +1968,12 @@ sub parse_options(@) {
# This problem has been covered by others - though no solution has # This problem has been covered by others - though no solution has
# been found: # been found:
# https://www.slideshare.net/NadiaEghbal/consider-the-maintainer # https://www.slideshare.net/NadiaEghbal/consider-the-maintainer
# https://blog.licensezero.com/2019/08/24/process-of-elimination.html
# https://www.numfocus.org/blog/why-is-numpy-only-now-getting-funded/ # https://www.numfocus.org/blog/why-is-numpy-only-now-getting-funded/
# #
# The FAQ tells you why the citation notice exists:
# https://git.savannah.gnu.org/cgit/parallel.git/tree/doc/citation-notice-faq.txt
#
# If you want GNU Parallel to be maintained in the future, and not # If you want GNU Parallel to be maintained in the future, and not
# just wither away like so many other free software tools, you # just wither away like so many other free software tools, you
# need to help finance the development. # need to help finance the development.
@ -2011,7 +2015,7 @@ sub parse_options(@) {
# https://www.admody.com/urteilsdatenbank/cafe6fdaeed3/OLG-Duesseldorf_Urteil_vom_28-September-2010_Az_I-20-U-41-09 # https://www.admody.com/urteilsdatenbank/cafe6fdaeed3/OLG-Duesseldorf_Urteil_vom_28-September-2010_Az_I-20-U-41-09
# https://web.archive.org/web/20180715073717/https://www.admody.com/urteilsdatenbank/cafe6fdaeed3/OLG-Duesseldorf_Urteil_vom_28-September-2010_Az_I-20-U-41-09 # https://web.archive.org/web/20180715073717/https://www.admody.com/urteilsdatenbank/cafe6fdaeed3/OLG-Duesseldorf_Urteil_vom_28-September-2010_Az_I-20-U-41-09
# #
# Other free software limiting derivates by the same name # Other free software limiting derivates by the same name:
# https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux_derivatives#Legal_aspects # https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux_derivatives#Legal_aspects
# https://tm.joomla.org/trademark-faq.html # https://tm.joomla.org/trademark-faq.html
# https://www.mozilla.org/en-US/foundation/trademarks/faq/ # https://www.mozilla.org/en-US/foundation/trademarks/faq/
@ -2025,7 +2029,7 @@ sub parse_options(@) {
# If you want GNU Parallel to be maintained in the future keep # If you want GNU Parallel to be maintained in the future keep
# this line. # this line.
citation_notice(); citation_notice();
# Seriously: *You* will be harming free software by removing the # Seriously: YOU will be harming free software by removing the
# notice. You make it harder to justify spending time developing # notice. You make it harder to justify spending time developing
# it. If you *do* remove the line, please email # it. If you *do* remove the line, please email
# hallofshame@tange.dk if you want to avoid being put in a hall of # hallofshame@tange.dk if you want to avoid being put in a hall of
@ -5312,7 +5316,17 @@ sub qqx(@) {
if($Global::debug) { if($Global::debug) {
return qx{ @_ && true }; return qx{ @_ && true };
} else { } else {
return qx{ ( @_ ) 2>/dev/null }; # CygWin does not respect 2>/dev/null
# so we do that by hand
open my $original_stderr, ">&", "STDERR" or
::die_bug("Can't dup STDERR: $!");
close STDERR;
open(STDERR, ">", "/dev/null");
my @ret = qx{ @_ };
close STDERR;
open STDERR, ">&", $original_stderr or
::die_bug("Can't dup STDERR: $!");
return wantarray ? @ret : join "",@ret;
} }
} }
@ -11404,10 +11418,14 @@ sub real_max_length($) {
# Find the max_length of a command line # Find the max_length of a command line
# Returns: # Returns:
# The maximal command line length # The maximal command line length
# This is slow on Cygwin, so give Cygwin users a warning
if($^O eq "cygwin") {
::warning("Finding the maximal command line length. This may take up to 30 seconds.")
}
# Use an upper bound of 100 MB if the shell allows for infinite long lengths # Use an upper bound of 100 MB if the shell allows for infinite long lengths
my $upper = 100_000_000; my $upper = 100_000_000;
# 1000 is supported everywhere, so the search can start anywhere 1..999 # 1000 is supported everywhere, so the search can start anywhere 1..999
# 324 makes the search much faster on CygWin, so let us use that # 324 makes the search much faster on Cygwin, so let us use that
my $len = 324; my $len = 324;
do { do {
if($len > $upper) { return $len }; if($len > $upper) { return $len };