pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/install When using bin-install, the version of the ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2411ae7a3d9b
branches:  trunk
changeset: 533451:2411ae7a3d9b
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Sep 19 13:26:19 2007 +0000

description:
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.

diffstat:

 mk/install/bin-install.mk |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 45329e64abcb -r 2411ae7a3d9b mk/install/bin-install.mk
--- a/mk/install/bin-install.mk Wed Sep 19 13:08:19 2007 +0000
+++ b/mk/install/bin-install.mk Wed Sep 19 13:26:19 2007 +0000
@@ -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 @@
        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;                \
        }



Home | Main Index | Thread Index | Old Index