pkgsrc-Changes-HG archive

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

[pkgsrc/pkgsrc-2006Q3]: pkgsrc/mk/install Pullup ticket 1849 - requested by r...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/66121171d511
branches:  pkgsrc-2006Q3
changeset: 519120:66121171d511
user:      salo <salo%pkgsrc.org@localhost>
date:      Sat Oct 07 15:36:51 2006 +0000

description:
Pullup ticket 1849 - requested by rillig
bugfix for bin-install target

Revisions pulled up:
- pkgsrc/mk/install/bin-install.mk                      1.5

   Module Name:         pkgsrc
   Committed By:        rillig
   Date:                Tue Oct  3 11:07:05 UTC 2006

   Modified Files:
        pkgsrc/mk/install: bin-install.mk

   Log Message:
   Rewrote the bin-install target so that it doesn't lock LOCALBASE
   recursively. This bug was reported by Hans Rosenfeld in

       http://mail-index.netbsd.org/tech-pkg/2006/10/03/0002.html

   As a side effect, when bin-install fails to install a binary package,
   the package is still built from source, but not as a privileged user.

diffstat:

 mk/install/bin-install.mk |  51 ++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 20 deletions(-)

diffs (74 lines):

diff -r 10322f81f8d4 -r 66121171d511 mk/install/bin-install.mk
--- a/mk/install/bin-install.mk Sat Oct 07 15:28:54 2006 +0000
+++ b/mk/install/bin-install.mk Sat Oct 07 15:36:51 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bin-install.mk,v 1.4 2006/08/09 15:31:01 jlam Exp $
+# $NetBSD: bin-install.mk,v 1.4.2.1 2006/10/07 15:36:51 salo Exp $
 #
 
 # This file provides the following targets:
@@ -23,19 +23,30 @@
 BINPKG_SITES?= \
        ftp://ftp.NetBSD.org/pub/NetBSD/packages/$${rel}/$${arch}
 
-_SU_BIN_INSTALL_TARGETS=       acquire-bin-install-lock
-_SU_BIN_INSTALL_TARGETS+=      locked-su-bin-install
-_SU_BIN_INSTALL_TARGETS+=      release-bin-install-lock
+.PHONY: bin-install
+.PHONY: do-bin-install do-bin-install-from-source
+.PHONY: su-do-bin-install
+.PHONY: aquire-bin-install-lock locked-su-do-bin-install release-bin-install-lock
+
+bin-install: \
+       do-bin-install \
+       do-bin-install-from-source
+
+do-bin-install: su-target
+       @${PHASE_MSG} "Binary install for "${PKGNAME_REQD:U${PKGNAME}:Q}
 
-.PHONY: acquire-bin-install-lock release-bin-install-lock
-acquire-bin-install-lock: acquire-localbase-lock
-release-bin-install-lock: release-localbase-lock
+su-do-bin-install: \
+       acquire-bin-install-lock \
+       locked-su-do-bin-install \
+       release-bin-install-lock
 
-# Install binary pkg, without strict uptodate-check first
-.PHONY: su-bin-install
-su-bin-install: ${_SU_BIN_INSTALL_TARGETS}
+acquire-bin-install-lock: \
+       acquire-localbase-lock
 
-locked-su-bin-install:
+release-bin-install-lock: \
+       release-localbase-lock
+
+locked-su-do-bin-install:
        @found=`${PKG_BEST_EXISTS} \"${PKGWILDCARD}\" || ${TRUE}`;      \
        if [ "$$found" != "" ]; then                                    \
                ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \
@@ -52,14 +63,14 @@
        ${STEP_MSG} "Installing ${PKGNAME} from $$pkgpath";             \
        if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}${PKG_SUFX}; then \
                ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
-       else                                                            \
-               ${SHCOMMENT} "Cycle through some FTP server here";      \
-               ${STEP_MSG} "No binary package found for ${PKGNAME} -- installing from source"; \
-               ${RECURSIVE_MAKE} ${MAKEFLAGS} package                  \
-                       DEPENDS_TARGET=${DEPENDS_TARGET:Q}              \
+       fi
+
+do-bin-install-from-source:
+       ${_PKG_SILENT}${_PKG_DEBUG} set -e;                             \
+       if ${PKG_INFO} -qe ${PKGNAME}; then                             \
+               : "Nothing to do";                                      \
+       else                                                            \
+               ${STEP_MSG} "No binary package found for ${PKGNAME}; installing from source."; \
+               ${RECURSIVE_MAKE} ${MAKEFLAGS} DEPENDS_TARGET=${DEPENDS_TARGET:Q} package \
                && ${RECURSIVE_MAKE} ${MAKEFLAGS} clean;                \
        fi
-
-.PHONY: bin-install
-bin-install: su-target
-       @${PHASE_MSG} "Binary install for "${PKGNAME_REQD:U${PKGNAME}:Q}



Home | Main Index | Thread Index | Old Index