From bddf7d4de3a0c0c9692b463fbbe88c970a2811b1 Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Fri, 6 May 2011 16:17:19 +0000 Subject: 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@ --- usr.sbin/sysmerge/sysmerge.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 # Copyright (c) 2008, 2009, 2010 Antoine Jacoutot @@ -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 -- cgit v1.2.3