create leading directories to match behavior of other do* programs
authorMike Frysinger <vapier@gentoo.org>
Sat, 14 Apr 2007 01:59:21 +0000 (01:59 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 14 Apr 2007 01:59:21 +0000 (01:59 -0000)
svn path=/main/trunk/; revision=6394

bin/dohard

index ce07f11c3467d8e4dc8a47527910dddc86dbed55..327bf5897db9337dde1b137a39f796e7c19d1535 100755 (executable)
@@ -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"