aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpt-lib10
1 files 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}"
}