From f7a4a106bf7907936e27532a95812563859a0de8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 16 Jul 2021 11:01:47 +0300 Subject: [PATCH] kiss: Correctly increment KISS_LVL --- kiss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kiss b/kiss index 036481b..316e3af 100755 --- a/kiss +++ b/kiss @@ -1682,8 +1682,8 @@ pkg_update() { pkg_clean() { # Clean up on exit or error. This removes everything related to the build. - case ${KISS_DEBUG:-0}-${KISS_LVL:-0} in - 0-0) + case ${KISS_DEBUG:-0}-${KISS_LVL:-1} in + 0-1) # If we are exiting the top-level package manager process, wipe # the entire temporary directory. rm -rf "$proc" @@ -1758,12 +1758,16 @@ args() { KISS_COLOR="$KISS_COLOR" \ KISS_TMPDIR="$KISS_TMPDIR" \ KISS_PID="$KISS_PID" \ - KISS_LVL="$((KISS_LVL + 1))" \ + KISS_LVL="$KISS_LVL" \ "$0" "$action" "$@" return } esac + # Need to increment KISS_LVL here to ensure we don't wipe the cash + # early by non-asroot invocations. + export KISS_LVL=$((KISS_LVL + 1)) + # Actions can be abbreviated to their first letter. This saves keystrokes # once you memorize the commands. case $action in