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}"; )
}