Tue Jun 15 04:14:26 2010 UTC ()
Apply my fix for PR 35091: do a check-vulnerable step first in "make
update", so if it's going to fail because of a known vulnerability it
does so before uninstalling anything. I've been carrying this patch
for some three years with no ill effects. Ok by agc@.


(dholland)
diff -r1.20 -r1.21 pkgsrc/mk/bsd.pkg.update.mk

cvs diff -r1.20 -r1.21 pkgsrc/mk/bsd.pkg.update.mk (expand / switch to unified diff)

--- pkgsrc/mk/bsd.pkg.update.mk 2010/02/25 02:08:33 1.20
+++ pkgsrc/mk/bsd.pkg.update.mk 2010/06/15 04:14:26 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.pkg.update.mk,v 1.20 2010/02/25 02:08:33 joerg Exp $ 1# $NetBSD: bsd.pkg.update.mk,v 1.21 2010/06/15 04:14:26 dholland Exp $
2# 2#
3# This Makefile fragment is included by bsd.pkg.mk and contains the targets 3# This Makefile fragment is included by bsd.pkg.mk and contains the targets
4# and variables for "make update". 4# and variables for "make update".
5# 5#
6# There is no documentation on what "update" actually does. This is merely 6# There is no documentation on what "update" actually does. This is merely
7# an attempt to separate the magic into a separate module that can be 7# an attempt to separate the magic into a separate module that can be
8# reimplemented later. 8# reimplemented later.
9# 9#
10 10
11NOCLEAN?= NO # don't clean up after update 11NOCLEAN?= NO # don't clean up after update
12REINSTALL?= NO # reinstall upon update 12REINSTALL?= NO # reinstall upon update
13 13
14# UPDATE_TARGET is the target that is invoked when updating packages during 14# UPDATE_TARGET is the target that is invoked when updating packages during
@@ -41,26 +41,27 @@ update-create-ddir: ${_DDIR} @@ -41,26 +41,27 @@ update-create-ddir: ${_DDIR}
41RESUMEUPDATE?= YES 41RESUMEUPDATE?= YES
42CLEAR_DIRLIST?= NO 42CLEAR_DIRLIST?= NO
43 43
44update: 44update:
45 @${PHASE_MSG} "Resuming update for ${PKGNAME}" 45 @${PHASE_MSG} "Resuming update for ${PKGNAME}"
46. if ${REINSTALL} != "NO" && ${UPDATE_TARGET} != "replace" 46. if ${REINSTALL} != "NO" && ${UPDATE_TARGET} != "replace"
47 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL 47 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL
48. endif 48. endif
49.else 49.else
50RESUMEUPDATE?= NO 50RESUMEUPDATE?= NO
51CLEAR_DIRLIST?= YES 51CLEAR_DIRLIST?= YES
52 52
53update: 53update:
 54 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} check-vulnerable
54 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} update-create-ddir 55 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} update-create-ddir
55. if ${UPDATE_TARGET} != "replace" 56. if ${UPDATE_TARGET} != "replace"
56 ${RUN} if ${PKG_INFO} -qe ${PKGBASE}; then \ 57 ${RUN} if ${PKG_INFO} -qe ${PKGBASE}; then \
57 ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \ 58 ${RECURSIVE_MAKE} ${MAKEFLAGS} deinstall _UPDATE_RUNNING=YES DEINSTALLDEPENDS=ALL \
58 || (${RM} ${_DDIR} && ${FALSE}); \ 59 || (${RM} ${_DDIR} && ${FALSE}); \
59 fi 60 fi
60. endif 61. endif
61.endif 62.endif
62 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} KEEP_WRKDIR=YES DEPENDS_TARGET=${DEPENDS_TARGET:Q} 63 ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} ${UPDATE_TARGET} KEEP_WRKDIR=YES DEPENDS_TARGET=${DEPENDS_TARGET:Q}
63 ${RUN} \ 64 ${RUN} \
64 [ ! -s ${_DDIR} ] || for dep in `${CAT} ${_DDIR}` ; do \ 65 [ ! -s ${_DDIR} ] || for dep in `${CAT} ${_DDIR}` ; do \
65 (if cd ../.. && cd "$${dep}" ; then \ 66 (if cd ../.. && cd "$${dep}" ; then \
66 ${PHASE_MSG} "Installing in $${dep}" && \ 67 ${PHASE_MSG} "Installing in $${dep}" && \