Commit 98e55386907c0ae6518eb117af9776e1986ef47d

Thomas de Grivel 2023-02-13T18:01:09

wip shpkg_tag_log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 2c979fe..44f1c95 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -83,14 +83,12 @@ shpkg_start_logging () {
 
 shpkg_tag_log () {
     SHPKG_LOG_TAG="$1"
-    SHPKG_LOG_TAG_DIR="$(dirname ${SHPKG_LOG_TAG})"
     SHPKG_LOG_TAG_PATH="${SHPKG_LOG_TAGS_DIR}/${SHPKG_LOG_TAG}"
     verbose -n 2 "logging to ${SHPKG_LOG_TAG_PATH}"
-    if [ -f "${SHPKG_LOG_TAG_PATH}" ]; then
+    if [ -f "${SHPKG_LOG_TAG_PATH}.tmp" ]; then
         verbose 1 rm "${SHPKG_LOG_TAG_PATH}.tmp"
     fi
     ( verbose 1 cd "${SHPKG_LOG_TAGS_DIR}" &&
-          verbose 1 mkdir -p "${SHPKG_LOG_TAG_DIR}" &&
           verbose 1 ln -s "${SHPKG_LOG_RELATIVE}" "${SHPKG_LOG_TAG}.tmp" &&
           verbose 1 mv "${SHPKG_LOG_TAG}.tmp" "${SHPKG_LOG_TAG}"; )
 }