From: ajacoutot Date: Wed, 30 Jul 2014 16:54:09 +0000 (+0000) Subject: Properly warn when an example changes and the corresponding file is found X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7a24d754b7dbb443bd41f7a3eaa4118fe290b41e;p=openbsd Properly warn when an example changes and the corresponding file is found under /etc. issue reported by Nathanael Rensen "fine" deraadt@ --- diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index 627b361f0e4..6c3d253aa9f 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.143 2014/07/20 08:19:59 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.144 2014/07/30 16:54:09 ajacoutot Exp $ # # Copyright (c) 2008-2014 Antoine Jacoutot # Copyright (c) 1998-2003 Douglas Barton @@ -632,7 +632,7 @@ sm_check_an_eg() { EGSUM=examplessum local _egmods _i _managed if [ -f "${DESTDIR}/${DBDIR}/${EGSUM}" ]; then - EGMODS="$(sha256 -c ${DESTDIR}/${DBDIR}/${EGSUM} 2>/dev/null | grep 'FAILED$' | awk '{ print $2 }' | sed -e "s,:,,")" + EGMODS="$(cd ${DESTDIR:=/} && sha256 -c ${DESTDIR}/${DBDIR}/${EGSUM} 2>/dev/null | grep 'FAILED$' | awk '{ print $2 }' | sed -e "s,:,,")" mv ${DESTDIR}/${DBDIR}/${EGSUM} ${DESTDIR}/${DBDIR}/.${EGSUM}.bak fi for _i in ${EGMODS}; do