summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2007-09-19 13:26:19 +0000
committerrillig <rillig>2007-09-19 13:26:19 +0000
commite03fce2c0c87fb58d55881bff20923e72f5e0614 (patch)
tree011370c73339b05d0944bad133eb89ed58072864
parentf46c6e08fbcd134b7b331d07bc06248e02607496 (diff)
downloadpkgsrc-e03fce2c0c87fb58d55881bff20923e72f5e0614.tar.gz
When using bin-install, the version of the installed package was checked
twice: First against the required package pattern (PKGNAME_REQD), and then against the current version (PKGNAME). When only a binary package for an old (but sufficient) version of a package was available, that version had been installed and the current version been built afterwards, which was unnecessary. This problem was mentioned in PR 36146, and is hereby fixed. By the way, the code was really ugly: The messages that had been printed didn't reflect what the code was actually doing. This is fixed, too.
-rw-r--r--mk/install/bin-install.mk15
1 files changed, 9 insertions, 6 deletions
diff --git a/mk/install/bin-install.mk b/mk/install/bin-install.mk
index b9ebc1ca02c..bd6d2b53e81 100644
--- a/mk/install/bin-install.mk
+++ b/mk/install/bin-install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bin-install.mk,v 1.12 2007/08/23 08:59:24 joerg Exp $
+# $NetBSD: bin-install.mk,v 1.13 2007/09/19 13:26:19 rillig Exp $
#
# This file provides the following targets:
@@ -94,15 +94,18 @@ locked-su-do-bin-install:
for i in ${BINPKG_SITES}; do \
pkgpath="$$pkgpath;$$i/All"; \
done; \
- ${STEP_MSG} "Installing ${PKGNAME} from $$pkgpath"; \
- if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}; then \
- ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
+ pkgpattern=${PKGNAME_REQD:U${PKGNAME}:Q}; \
+ ${STEP_MSG} "Installing $$pkgpattern from $$pkgpath"; \
+ if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \
+ installed=`${PKG_INFO} -e "$$pkgpattern"`; \
+ ${ECHO} "$$installed successfully installed."; \
fi
.endif
do-bin-install-from-source:
- ${RUN} ${PKG_INFO} -qe ${PKGNAME} || { \
- ${STEP_MSG} "No binary package found for ${PKGNAME}; installing from source."; \
+ ${RUN} pkgpattern=${PKGNAME_REQD:U${PKGNAME}:Q}; \
+ ${PKG_INFO} -qe "$$pkgpattern" || { \
+ ${STEP_MSG} "No binary package found for $$pkgpattern; installing from source."; \
${RECURSIVE_MAKE} ${MAKEFLAGS} DEPENDS_TARGET=${DEPENDS_TARGET:Q} package-install \
&& ${RECURSIVE_MAKE} ${MAKEFLAGS} clean; \
}