summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-05-06 16:17:19 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2011-05-06 16:17:19 +0000
commitbddf7d4de3a0c0c9692b463fbbe88c970a2811b1 (patch)
tree599ae73255fbdb5aa7f81b31f78dccbc5b4fcd5b
parent22e936675a3f18936cb6a13cd5f15dec28e0bca5 (diff)
If it doesn't exist, create the directory holding the link we are about
to create, otherwise sysmerge will fail installing it. This can happen for example when you only installed etcXX but run sysmerge against both etcXX and xetcXX. found the hard way by and ok sthen@
-rw-r--r--usr.sbin/sysmerge/sysmerge.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh
index 184bd11ee21..6a368fae92f 100644
--- a/usr.sbin/sysmerge/sysmerge.sh
+++ b/usr.sbin/sysmerge/sysmerge.sh
@@ -1,6 +1,6 @@
#!/bin/ksh -
#
-# $OpenBSD: sysmerge.sh,v 1.71 2011/04/27 08:44:48 ajacoutot Exp $
+# $OpenBSD: sysmerge.sh,v 1.72 2011/05/06 16:17:18 ajacoutot Exp $
#
# Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org>
# Copyright (c) 2008, 2009, 2010 Antoine Jacoutot <ajacoutot@openbsd.org>
@@ -237,6 +237,11 @@ mm_install() {
mm_install_link() {
_LINKT=`readlink ${COMPFILE}`
_LINKF=`dirname ${DESTDIR}${COMPFILE#.}`
+
+ DIR_MODE=`stat -f "%OMp%OLp" "${TEMPROOT}/${_LINKF}"`
+ [ ! -d "${_LINKF}" ] && \
+ install -d -o root -g wheel -m "${DIR_MODE}" "${_LINKF}"
+
rm -f ${COMPFILE}
(cd ${_LINKF} && ln -sf ${_LINKT} .)
return