diff options
author | rillig <rillig@pkgsrc.org> | 2006-08-04 20:52:27 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-08-04 20:52:27 +0000 |
commit | a5c5777ae52d24f0f96c81e099485eb4ba8513c3 (patch) | |
tree | c6403946f8ea93813813b4b26d0a6531fa3c42b7 /mk/install | |
parent | f96c7840bb3d73339241fe2e22c18027f103925e (diff) | |
download | pkgsrc-a5c5777ae52d24f0f96c81e099485eb4ba8513c3.tar.gz |
Fixed the locking, as suggested by Johnny on the tech-pkg mailing list.
Added two targets acquire-localbase-lock and release-localbase-lock,
which mark the complete LOCALBASE directory as locked, so that multiple
packages cannot run the install, deinstall or bin-install targets at the
same time.
The install target aquires locks in both WRKSRC and LOCALBASE, the other
two targets only need the LOCALBASE lock, since they may be run without
WRKSRC being present on the system.
locking.mk must be included before tools.mk and the PKG_FAIL_REASON
check.
Diffstat (limited to 'mk/install')
-rw-r--r-- | mk/install/bin-install.mk | 6 | ||||
-rw-r--r-- | mk/install/deinstall.mk | 13 | ||||
-rw-r--r-- | mk/install/install.mk | 6 |
3 files changed, 17 insertions, 8 deletions
diff --git a/mk/install/bin-install.mk b/mk/install/bin-install.mk index 8ef5fabd848..0fb73ed3d2b 100644 --- a/mk/install/bin-install.mk +++ b/mk/install/bin-install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bin-install.mk,v 1.2 2006/08/04 07:17:58 rillig Exp $ +# $NetBSD: bin-install.mk,v 1.3 2006/08/04 20:52:27 rillig Exp $ # # This file provides the following targets: @@ -28,8 +28,8 @@ _SU_BIN_INSTALL_TARGETS+= locked-su-bin-install _SU_BIN_INSTALL_TARGETS+= release-bin-install-lock .PHONY: acquire-bin-install-lock release-bin-install-lock -acquire-bin-install-lock: acquire-lock -release-bin-install-lock: release-lock +acquire-bin-install-lock: acquire-localbase-lock +release-bin-install-lock: release-localbase-lock # Install binary pkg, without strict uptodate-check first .PHONY: su-bin-install diff --git a/mk/install/deinstall.mk b/mk/install/deinstall.mk index 0f5423b6fe7..9ae3e50edde 100644 --- a/mk/install/deinstall.mk +++ b/mk/install/deinstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: deinstall.mk,v 1.4 2006/08/03 19:12:43 rillig Exp $ +# $NetBSD: deinstall.mk,v 1.5 2006/08/04 20:52:27 rillig Exp $ # DEINSTALLDEPENDS controls whether dependencies and dependents are also # removed when a package is de-installed. The valid values are: @@ -21,7 +21,16 @@ deinstall: su-target @${PHASE_MSG} "Deinstalling for ${PKGNAME}" .endif -su-deinstall: acquire-install-lock deinstall-pkg release-install-lock install-clean +_SU_DEINSTALL_TARGETS= acquire-deinstall-lock +_SU_DEINSTALL_TARGETS+= deinstall-pkg +_SU_DEINSTALL_TARGETS+= release-deinstall-lock +_SU_DEINSTALL_TARGETS+= install-clean +su-deinstall: ${_SU_DEINSTALL_TARGETS} +.ORDER: ${_SU_DEINSTALL_TARGETS} + +.PHONY: acquire-deinstall-lock release-deinstall-lock +acquire-deinstall-lock: acquire-localbase-lock +release-deinstall-lock: release-localbase-lock MAKEFLAGS.su-deinstall= DEINSTALLDEPENDS=${DEINSTALLDEPENDS} diff --git a/mk/install/install.mk b/mk/install/install.mk index bac0c4db5fb..3f4c7368b7e 100644 --- a/mk/install/install.mk +++ b/mk/install/install.mk @@ -1,4 +1,4 @@ -# $NetBSD: install.mk,v 1.15 2006/07/27 21:46:46 jlam Exp $ +# $NetBSD: install.mk,v 1.16 2006/08/04 20:52:27 rillig Exp $ ###################################################################### ### install (PUBLIC) @@ -25,8 +25,8 @@ install: barrier .endif .PHONY: acquire-install-lock release-install-lock -acquire-install-lock: acquire-lock -release-install-lock: release-lock +acquire-install-lock: acquire-lock acquire-localbase-lock +release-install-lock: release-lock release-localbase-lock .if exists(${_COOKIE.install}) ${_COOKIE.install}: |