summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-04-14 01:59:21 +0000
committerMike Frysinger <vapier@gentoo.org>2007-04-14 01:59:21 +0000
commit1949862cdf0e63e3347983602d51549b9e2944bf (patch)
tree7df75df606d4e220624bf099c7cc4f8b13564af7
parentb6b6e08774bd428b9490b1585e3e05abd83ec7b1 (diff)
downloadportage-1949862cdf0e63e3347983602d51549b9e2944bf.tar.gz
portage-1949862cdf0e63e3347983602d51549b9e2944bf.tar.bz2
portage-1949862cdf0e63e3347983602d51549b9e2944bf.zip
create leading directories to match behavior of other do* programs
svn path=/main/trunk/; revision=6394
-rwxr-xr-xbin/dohard9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/dohard b/bin/dohard
index ce07f11c3..327bf5897 100755
--- a/bin/dohard
+++ b/bin/dohard
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -8,6 +8,7 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
-target=$1
-linkname=$2
-exec ln -f "${D}${target}" "${D}${linkname}"
+destdir=${2%/*}
+[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+
+exec ln -f "$1" "${D}$2"