From 14233491c517f1d6e2456d29b35ae99db76a23ac Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 21 Dec 2020 09:49:03 +0000 Subject: create_cache(): new variable and argument changes - If an argument is supplied to create_cache(), it will not create the default subdirectories (build/pkg/export). - create_cache() now also globally sets the $tmp_dir variable, which is the default directory + $pid variable Changes above do not affect the previous usage of the function, so it is not considered a breaking change. FossilOrigin-Name: 2eb5bc89e2e1c688186667af0d5177a1cdc3dc2e83e28e134752955c68a5c4e0 --- src/cpt-lib | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cpt-lib b/src/cpt-lib index c75fbcf..8e4ef87 100644 --- a/src/cpt-lib +++ b/src/cpt-lib @@ -1763,10 +1763,12 @@ create_cache() { # # Create the required temporary directories and set the variables # which point to them. - mkdir -p "${CPT_TMPDIR:=$cac_dir/proc}" \ - "${mak_dir:=$CPT_TMPDIR/$pid/build}" \ - "${pkg_dir:=$CPT_TMPDIR/$pid/pkg}" \ - "${tar_dir:=$CPT_TMPDIR/$pid/export}" + mkdir -p "${tmp_dir:=${CPT_TMPDIR:=$cac_dir/proc}/$pid}" + + # If an argument is given, skip the creation of other cache directories + [ "$1" ] || mkdir -p "${mak_dir:=$tmp_dir/build}" \ + "${pkg_dir:=$tmp_dir/pkg}" \ + "${tar_dir:=$tmp_dir/export}" } -- cgit v1.2.3