summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-12-14 14:06:56 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2009-12-14 14:06:56 +0000
commit2046ed204293af6e61cea3ff63b9494dd95a4530 (patch)
treeb8450c256fcbb2fbbb5682d12203b350513661ea
parent5d13e0235126a1363b9d00b4418143e2e931ecbe (diff)
Make tmp symlink relative if easily possible
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@433 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xcreate-temp6
1 files changed, 5 insertions, 1 deletions
diff --git a/create-temp b/create-temp
index 5bbf475..95cde7f 100755
--- a/create-temp
+++ b/create-temp
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2006 Peter Palfrader <peter@palfrader.org>
#
@@ -36,5 +36,9 @@ if ! [ -L "$TARGET" ] && [ -e "$TARGET" ]; then
exit 1;
fi
+target_dir="$(dirname "$TARGET")"
+if [ "${BASE##$target_dir/}" != "$BASE" ]; then
+ BASE="${BASE##$target_dir/}"
+fi
rm -f "$TARGET"
ln -s "$BASE/$TODAY" "$TARGET"