| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: replace.mk,v 1.8 2021/01/17 20:18:42 rhialto Exp $ | | 1 | # $NetBSD: replace.mk,v 1.9 2024/01/26 12:42:01 riastradh Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | # _pkgformat-destdir-replace: | | 4 | # _pkgformat-destdir-replace: |
5 | # Updates a package in-place on the system. | | 5 | # Updates a package in-place on the system. |
6 | # | | 6 | # |
7 | # See also: | | 7 | # See also: |
8 | # replace | | 8 | # replace |
9 | # | | 9 | # |
10 | # XXX: The whole replacement, from deinstalling the old package up | | 10 | # XXX: The whole replacement, from deinstalling the old package up |
11 | # to installing the new package, should be one transaction. | | 11 | # to installing the new package, should be one transaction. |
12 | # | | 12 | # |
13 | _pkgformat-replace: \ | | 13 | _pkgformat-replace: \ |
14 | replace-tarup \ | | 14 | replace-tarup \ |
| @@ -187,27 +187,27 @@ replace-clean: .PHONY | | | @@ -187,27 +187,27 @@ replace-clean: .PHONY |
187 | # Logically we would like to do a "pkg_add -U". However, that fails | | 187 | # Logically we would like to do a "pkg_add -U". However, that fails |
188 | # if there is a depending package that exactly depends on the package | | 188 | # if there is a depending package that exactly depends on the package |
189 | # being replaced, so we override that check with -D. Historically, | | 189 | # being replaced, so we override that check with -D. Historically, |
190 | # 'make replace' would replace a package regardless of whether that | | 190 | # 'make replace' would replace a package regardless of whether that |
191 | # broke depending packages (typically due to shlib ABI changes, | | 191 | # broke depending packages (typically due to shlib ABI changes, |
192 | # especially major version bumps). Therefore, make replace in DESTDIR | | 192 | # especially major version bumps). Therefore, make replace in DESTDIR |
193 | # mode should behave the same way. unsafe_depends will be set on | | 193 | # mode should behave the same way. unsafe_depends will be set on |
194 | # depending packages, and then those may be rebuilt via a manual | | 194 | # depending packages, and then those may be rebuilt via a manual |
195 | # process or by pkg_rolling-replace. | | 195 | # process or by pkg_rolling-replace. |
196 | replace-destdir: .PHONY | | 196 | replace-destdir: .PHONY |
197 | @${PHASE_MSG} "Updating using binary package of "${PKGNAME:Q} | | 197 | @${PHASE_MSG} "Updating using binary package of "${PKGNAME:Q} |
198 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | | 198 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) |
199 | @${MKDIR} ${_CROSS_DESTDIR}${PREFIX} | | 199 | @${MKDIR} ${_CROSS_DESTDIR}${PREFIX} |
200 | ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE} | | 200 | ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D -m ${OPSYS:Q}/${MACHINE_ARCH:Q}\ ${OS_VERSION:Q} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE} |
201 | @${ECHO} "Fixing recorded cwd..." | | 201 | @${ECHO} "Fixing recorded cwd..." |
202 | @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp | | 202 | @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp |
203 | @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS | | 203 | @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS |
204 | .else | | 204 | .else |
205 | ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D ${STAGE_PKGFILE} | | 205 | ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D ${STAGE_PKGFILE} |
206 | .endif | | 206 | .endif |
207 | ${RUN}${_REPLACE_OLDNAME_CMD}; \ | | 207 | ${RUN}${_REPLACE_OLDNAME_CMD}; \ |
208 | ${PKG_INFO} -qR ${PKGNAME:Q} | while read pkg; do \ | | 208 | ${PKG_INFO} -qR ${PKGNAME:Q} | while read pkg; do \ |
209 | [ -n "$$pkg" ] || continue; \ | | 209 | [ -n "$$pkg" ] || continue; \ |
210 | ${PKG_ADMIN} set unsafe_depends_strict=YES "$$pkg"; \ | | 210 | ${PKG_ADMIN} set unsafe_depends_strict=YES "$$pkg"; \ |
211 | if [ "$$oldname" != ${PKGNAME:Q} ]; then \ | | 211 | if [ "$$oldname" != ${PKGNAME:Q} ]; then \ |
212 | ${PKG_ADMIN} set unsafe_depends=YES "$$pkg"; \ | | 212 | ${PKG_ADMIN} set unsafe_depends=YES "$$pkg"; \ |
213 | fi; \ | | 213 | fi; \ |