From 2046ed204293af6e61cea3ff63b9494dd95a4530 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 14 Dec 2009 14:06:56 +0000 Subject: Make tmp symlink relative if easily possible git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@433 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- create-temp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'create-temp') 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 # @@ -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" -- cgit v1.2.3