Skip to content

Commit

Permalink
The "replace" target does conceptually the same thing as the "install"
Browse files Browse the repository at this point in the history
target in that it installs the currently-built software into the
filesystem.  In that case where "replace" is specified as a target on
the command line, make "replace" and not "install" be the source target
for "package".

Also, place the "replace" target between the "install" and "package"
targets in _BARRIER_POST_TARGETS as it should be legal to do those
steps in that order (but not in another order).

These changes make the following work:

	make replace package

In this example, the currently installed package will be replaced and
the newly-installed software will be packaged, all within the same
make process.
  • Loading branch information
jlam committed Jul 6, 2006
1 parent 9e0bad9 commit 2a1f0f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 2 additions & 4 deletions mk/bsd.pkg.barrier.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.barrier.mk,v 1.3 2006/07/06 15:43:10 jlam Exp $
# $NetBSD: bsd.pkg.barrier.mk,v 1.4 2006/07/06 22:08:32 jlam Exp $

_BARRIER_COOKIE= ${WRKDIR}/.barrier_cookie

Expand All @@ -19,12 +19,10 @@ _BARRIER_POST_TARGETS+= test
_BARRIER_POST_TARGETS+= all
_BARRIER_POST_TARGETS+= install
_BARRIER_POST_TARGETS+= reinstall
_BARRIER_POST_TARGETS+= replace
_BARRIER_POST_TARGETS+= package
_BARRIER_POST_TARGETS+= repackage

# XXX This target should probably be handled specially.
_BARRIER_POST_TARGETS+= replace

.for _target_ in ${_BARRIER_POST_TARGETS}
. if make(${_target_})
_BARRIER_CMDLINE_TARGETS+= ${_target_}
Expand Down
6 changes: 5 additions & 1 deletion mk/package/package.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: package.mk,v 1.11 2006/07/05 22:21:03 jlam Exp $
# $NetBSD: package.mk,v 1.12 2006/07/06 22:08:32 jlam Exp $

######################################################################
### package (PUBLIC)
Expand All @@ -7,7 +7,11 @@
### acquire elevated privileges just-in-time.
###
_PACKAGE_TARGETS+= check-vulnerable
.if make(replace)
_PACKAGE_TARGETS+= replace
.else
_PACKAGE_TARGETS+= install
.endif
_PACKAGE_TARGETS+= acquire-package-lock
_PACKAGE_TARGETS+= ${_PACKAGE_COOKIE}
_PACKAGE_TARGETS+= release-package-lock
Expand Down

0 comments on commit 2a1f0f0

Please sign in to comment.