#!/bin/ksh -
#
-# $OpenBSD: sysmerge.sh,v 1.215 2015/10/16 19:55:39 ajacoutot Exp $
+# $OpenBSD: sysmerge.sh,v 1.216 2015/10/18 04:45:21 ajacoutot Exp $
#
# Copyright (c) 2008-2014 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org>
done
rm -rf ${_BKPDIR}.4
[[ -d ${_BKPDIR} ]] && mv ${_BKPDIR} ${_BKPDIR}.0
- install -d ${_BKPDIR} || return
+ # make sure this function is only run _once_ per sysmerge invocation
+ unset -f sm_rotate_bak
}
# get pkg @sample information
fi
if [[ -f ${TARGET} ]]; then
- sm_rotate_bak || return
+ if typeset -f sm_rotate_bak >/dev/null; then
+ sm_rotate_bak || return
+ fi
mkdir -p ${_BKPDIR}/${_instdir} || return
cp -p ${TARGET} ${_BKPDIR}/${_instdir} || return
fi