From 96e0ccfbdd882493b4ed0d78cbb3265ef1f7c66c Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 6 Feb 2026 16:44:42 -0500 Subject: [PATCH] fix: clean the message file Fixes #3 --- leaf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/leaf b/leaf index d8c071f..9267653 100755 --- a/leaf +++ b/leaf @@ -24,6 +24,7 @@ export TESTSUITEFLAGS="-j${PARALLEL_JOBS}" export LANG=C export LC_CTYPE=C.UTF-8 export leaf_flags="CFLAGS CXXFLAGS FCFLAGS FFLAGS RUSTFLAGS" +export LEAF_MESSAGE_DIR="${TEMP_DIR:-/tmp}/leaf-messages" for flag in ${leaf_flags}; do export $flag done @@ -355,7 +356,7 @@ EOF leaf_message_init() { # one log per package invocation - local d="${TEMP_DIR}/leaf-messages/${PKG_PREFIX}/${PKG_NAME}" + local d="${LEAF_MESSAGE_DIR}/${PKG_PREFIX}/${PKG_NAME}" install -dm755 -- "$d" LEAF_MESSAGE_FILE="${d}/messages.$$.$(date +%Y%m%d%H%M%S).log" : > "${LEAF_MESSAGE_FILE}" @@ -392,9 +393,10 @@ leaf_print_message() { echo -e "\n${PURPLE_COLOR}* Message from ${prefix}/${name}${CLEAR_COLOR}\n" cat -- "$f" - rm -f -- "$f" done + rm -rf -- "${LEAF_MESSAGE_DIR}"/* + LEAF_MESSAGE_FILES=() unset LEAF_MESSAGE_FILE }