From 0962927eb9a132f4323c8685a5ce3934a2f31c32 Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 25 Jun 2021 07:34:03 +0000 Subject: main(): don't create $tmp_dir, only declare its variable FossilOrigin-Name: 6fd840fac7d14a2116ad4b2a69b82e2f10f1bbee0ecdc4cd7cc788ab1c530881 --- src/cpt-lib.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 0d418e6..4e687c4 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -2081,11 +2081,15 @@ create_cache() { # We create the temporary directory here to avoid permission issues that can # arise from functions that call as_root(). mkdir -p "${cac_dir:=${CPT_CACHE:=${XDG_CACHE_HOME:-$HOME/.cache}/cpt}}" \ - "${tmp_dir:=${CPT_TMPDIR:=$cac_dir/proc}/$pid}" \ + "${CPT_TMPDIR:=$cac_dir/proc}" \ "${src_dir:=$cac_dir/sources}" \ "${log_dir:=$cac_dir/logs}" \ "${bin_dir:=$cac_dir/bin}" + # We don't create the temporary $pid directory until `create_tmp()` is + # called, but we still declare its variable here. + : "${tmp_dir:=${CPT_TMPDIR:=$cac_dir/proc}/$pid}" + # Set the location to the repository and package database. pkg_db=var/db/cpt/installed -- cgit v1.2.3