From e57686278e4d578c81cee183d62d91711bb21a56 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sat, 15 Jun 2024 12:22:31 +0200 Subject: [PATCH] parallel: Fixed bug #65736: Default values for XDG_CONFIG_HOME XDG_CACHE_HOME --- doc/release_new_version | 2 +- src/parallel | 8 ++++---- testsuite/tests-to-run/parallel-local-30s.sh | 5 +++++ testsuite/wanted-results/parallel-local-30s | 9 ++++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index fd494b37..f0607ebe 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -273,7 +273,7 @@ from:tange@gnu.org to:parallel@gnu.org, bug-parallel@gnu.org stable-bcc: Jesse Alama -Subject: GNU Parallel 20240622 ('34 counts/(Raisi-IRAN preƦsentdt)/spurlock(supersize)') released +Subject: GNU Parallel 20240622 ('Versailles/34 counts/(Raisi-IRAN preƦsentdt)/spurlock(supersize)') released GNU Parallel 20240122 ('Frederik X') has been released. It is available for download at: lbry://@GnuParallel:4 diff --git a/src/parallel b/src/parallel index 9747dc53..14eb003d 100755 --- a/src/parallel +++ b/src/parallel @@ -2931,7 +2931,7 @@ sub init_globals() { eval { File::Path::mkpath($ENV{'PARALLEL_HOME'}); }; } # $xdg_config_home is needed to make env_parallel.fish stop complaining - my $xdg_config_home = $ENV{'XDG_CONFIG_HOME'}; + my $xdg_config_home = $ENV{'XDG_CONFIG_HOME'} || $ENV{'HOME'} . "/.config"; # Use the first config dir that exists from: # $PARALLEL_HOME # $XDG_CONFIG_HOME/parallel @@ -2957,11 +2957,11 @@ sub init_globals() { # $PARALLEL_HOME # $XDG_CACHE_HOME/parallel # Keep only dirs that exist + my $xdg_cache_home = $ENV{'XDG_CACHE_HOME'} || $ENV{'HOME'} . "/.cache"; @Global::cache_dirs = (grep { -d $_ } $ENV{'PARALLEL_HOME'}, - $ENV{'XDG_CACHE_HOME'}."/parallel"); - $Global::cache_dir = $Global::cache_dirs[0] || - $ENV{'HOME'} . "/.parallel"; + $xdg_cache_home."/parallel"); + $Global::cache_dir = $Global::cache_dirs[0] || $ENV{'HOME'} . "/.parallel"; Job::init_color(); } diff --git a/testsuite/tests-to-run/parallel-local-30s.sh b/testsuite/tests-to-run/parallel-local-30s.sh index ff1ec912..a52505a0 100755 --- a/testsuite/tests-to-run/parallel-local-30s.sh +++ b/testsuite/tests-to-run/parallel-local-30s.sh @@ -322,6 +322,9 @@ par_internal_quote_char() { ::: -X -q -Xq -k | # Upgrade old bash error to new bash error perl -pe 's/No such file or directory/Invalid or incomplete multibyte or wide character/g' + # Bug in Perl's SQL::CSV module cannot handle dir with \n + TMPDIR=/tmp + TMPDIR=$(mktemp -d) cd "$TMPDIR" echo "Compare old quote char csv" parallel-20231222 --sqlmaster csv:///./oldformat.csv echo "$(printf "\257\257 \177\177")" ::: 1 2 3 @@ -332,6 +335,8 @@ par_internal_quote_char() { stdout parallel -k --sqlworker csv:///./newformat.csv echo "$(printf "\257\257 \177\177")" ::: 1 2 3 | od -t x1z > new.out diff old.out new.out && echo OK + rm -f old.out new.out oldformat.csv newformat.csv + rmdir "$TMPDIR" } par_groupby() { diff --git a/testsuite/wanted-results/parallel-local-30s b/testsuite/wanted-results/parallel-local-30s index 5ad8200f..53ed5292 100644 --- a/testsuite/wanted-results/parallel-local-30s +++ b/testsuite/wanted-results/parallel-local-30s @@ -2843,9 +2843,12 @@ par_internal_quote_char <<> -Xq /usr/bin/bash: line 1: $'echo \177<\177<\177 par_internal_quote_char <<> -k <<> par_internal_quote_char <<> -k <<> <<> par_internal_quote_char <<> -k <<><<> -par_internal_quote_char <<> -k /usr/bin/bash: line 1: : No such file or directory -par_internal_quote_char <<> -k /usr/bin/bash: line 1: : No such file or directory -par_internal_quote_char <<> -k /usr/bin/bash: line 1: : No such file or directory +par_internal_quote_char <<> -k /usr/bin/bash: line 1: : Invalid or incomplete multibyte or wide character +par_internal_quote_char <<> -k /usr/bin/bash: line 1: : Invalid or incomplete multibyte or wide character +par_internal_quote_char <<> -k /usr/bin/bash: line 1: : Invalid or incomplete multibyte or wide character +par_internal_quote_char Compare old quote char csv +par_internal_quote_char with new quote char csv (must be the same) +par_internal_quote_char OK par_max_length_len_128k ### BUG: The length for -X is not close to max (131072) par_max_length_len_128k 63xxx par_max_length_len_128k 63xxx