bugGNU Parallel - Bugs: bug #65736, Default values for XDG_CONFIG_HOME...

 
 

bug #65736: Default values for XDG_CONFIG_HOME and XDG_CACHE_HOME

Submitter:  None
Submitted:  Mon 13 May 2024 07:29:26 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  tange
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 May 2024 07:29:26 PM UTC, original submission:  

According to: https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html

The XDG Base Directory spec (v0.8) states:

If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

The following change may do the trick. Thanks!

--- /usr/bin/parallel 2023-08-24 00:19:26.000000000 -0400
+++ parallel 2024-05-13 15:19:23.042412019 -0400
@@ -2933,7 +2933,7 @@
  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
@@ -2959,9 +2959,10 @@
     #   $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");
+   $xdg_cache_home."/parallel");
     $Global::cache_dir = $Global::cache_dirs[0] ||
  $ENV{'HOME'} . "/.parallel";
     Job::init_color();


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tange (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-06-15 tange StatusNone In Progress
        Assigned toNone tange

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code