From: ajacoutot Date: Sun, 20 Jul 2014 08:19:59 +0000 (+0000) Subject: Fix auto-upgradable files detection. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1a53bbcfc66b3e25723eb8f2ae4601ed6de62db6;p=openbsd Fix auto-upgradable files detection. from Nathanael Rensen, thanks! --- diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index 5a02a4df073..627b361f0e4 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.142 2014/07/18 10:43:29 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.143 2014/07/20 08:19:59 ajacoutot Exp $ # # Copyright (c) 2008-2014 Antoine Jacoutot # Copyright (c) 1998-2003 Douglas Barton @@ -194,7 +194,7 @@ sm_populate() { fi # set auto-upgradable files - _D=$(diff -u ${WRKDIR}/${i} ${DESTDIR}/${DBDIR}/${i} | grep -E '^\+' | sed '1d' | awk '{print $3}') + _D=$(diff -u ${WRKDIR}/${i} ${DESTDIR}/${DBDIR}/${i} | sed -n 's/^+SHA256 (\(.*\)).*/\1/p') for _d in ${_D}; do # 2>/dev/null: if file got removed manually but is still in the sum file CURSUM=$(cd ${DESTDIR:=/} && sha256 ${_d} 2>/dev/null)