pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   jlam
Date:           Sat Aug 19 00:30:19 UTC 2017

Modified Files:
        pkgsrc/mk/install: bin-install.mk
        pkgsrc/mk/pkgformat/pkg: deinstall.mk package.mk pkgformat-vars.mk
            replace.mk

Log Message:
Run pkg_add(1) and pkg_delete(1) using ${SETENV} ${PKGTOOLS_ENV}.

PKGTOOLS_ENV allows for passing environment variables to the
package install and deinstall scripts.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 pkgsrc/mk/install/bin-install.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/deinstall.mk
cvs rdiff -u -r1.15 -r1.16 pkgsrc/mk/pkgformat/pkg/package.mk
cvs rdiff -u -r1.6 -r1.7 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
cvs rdiff -u -r1.4 -r1.5 pkgsrc/mk/pkgformat/pkg/replace.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/install/bin-install.mk
diff -u pkgsrc/mk/install/bin-install.mk:1.25 pkgsrc/mk/install/bin-install.mk:1.26
--- pkgsrc/mk/install/bin-install.mk:1.25       Thu Jun 16 18:28:45 2016
+++ pkgsrc/mk/install/bin-install.mk    Sat Aug 19 00:30:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: bin-install.mk,v 1.25 2016/06/16 18:28:45 mspo Exp $
+# $NetBSD: bin-install.mk,v 1.26 2017/08/19 00:30:19 jlam Exp $
 #
 
 # This file provides the following targets:
@@ -93,7 +93,7 @@ locked-su-do-bin-install:
 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
        ${RUN} ${_BIN_INSTALL_PREPARE_CMD}                              \
        ${STEP_MSG} "Installing ${PKGNAME} from $$pkg_path";            \
-       if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:Q}${PKG_SUFX}; then \
+       if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:Q}${PKG_SUFX}; then \
                ${ECHO} "Fixing recorded cwd...";                       \
                ${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp; \
                ${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS; \
@@ -103,7 +103,7 @@ locked-su-do-bin-install:
        ${RUN} ${_BIN_INSTALL_PREPARE_CMD}                              \
        pkgpattern=${PKGNAME_REQD:Q};                                   \
        ${STEP_MSG} "Installing $$pkgpattern from $$pkg_path";          \
-       if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \
+       if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \
                installed=`${PKG_INFO} -e "$$pkgpattern"`;              \
                ${ECHO} "$$installed successfully installed.";          \
        fi

Index: pkgsrc/mk/pkgformat/pkg/deinstall.mk
diff -u pkgsrc/mk/pkgformat/pkg/deinstall.mk:1.2 pkgsrc/mk/pkgformat/pkg/deinstall.mk:1.3
--- pkgsrc/mk/pkgformat/pkg/deinstall.mk:1.2    Thu May  9 23:37:26 2013
+++ pkgsrc/mk/pkgformat/pkg/deinstall.mk        Sat Aug 19 00:30:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.2 2013/05/09 23:37:26 riastradh Exp $
+# $NetBSD: deinstall.mk,v 1.3 2017/08/19 00:30:19 jlam Exp $
 
 # Set the appropriate flags to pass to pkg_delete(1) based on the value
 # of DEINSTALLDEPENDS (see pkgsrc/mk/install/deinstall.mk).
@@ -43,7 +43,7 @@ _pkgformat-deinstall: .PHONY
        esac;                                                           \
        if ${TEST} -n "$$found"; then                                   \
                ${ECHO} "Running ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} $$found"; \
-               ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} "$$found" || ${TRUE} ; \
+               ${SETENV} ${PKGTOOLS_ENV} ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} "$$found" || ${TRUE} ; \
        fi
 .if defined(DEINSTALLDEPENDS) && !empty(DEINSTALLDEPENDS:M[yY][eE][sS])
 # XXX Need to handle BUILD_DEPENDS/TOOL_DEPENDS split.
@@ -52,7 +52,7 @@ _pkgformat-deinstall: .PHONY
        found=`${_PKG_BEST_EXISTS} ${_pkg_:Q} || ${TRUE}`;              \
        if ${TEST} -n "$$found"; then                                   \
                ${ECHO} "Running ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} $$found"; \
-               ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} "$$found" || ${TRUE}; \
+               ${SETENV} ${PKGTOOLS_ENV} ${PKG_DELETE} ${_PKG_ARGS_DEINSTALL} "$$found" || ${TRUE}; \
        fi
 .  endfor
 .endif

Index: pkgsrc/mk/pkgformat/pkg/package.mk
diff -u pkgsrc/mk/pkgformat/pkg/package.mk:1.15 pkgsrc/mk/pkgformat/pkg/package.mk:1.16
--- pkgsrc/mk/pkgformat/pkg/package.mk:1.15     Mon May  9 00:07:23 2016
+++ pkgsrc/mk/pkgformat/pkg/package.mk  Sat Aug 19 00:30:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.15 2016/05/09 00:07:23 joerg Exp $
+# $NetBSD: package.mk,v 1.16 2017/08/19 00:30:19 jlam Exp $
 
 .if defined(PKG_SUFX)
 WARNINGS+=             "PKG_SUFX is deprecated, please use PKG_COMPRESSION"
@@ -144,13 +144,14 @@ su-real-package-install:
        @${PHASE_MSG} "Installing binary package of "${PKGNAME:Q}
 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
        @${MKDIR} ${_CROSS_DESTDIR}${PREFIX}
-       ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE}
+       ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE}
        @${ECHO} "Fixing recorded cwd..."
        @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp
        @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS
 .else
        ${RUN} case ${_AUTOMATIC:Q}"" in                                        \
-       [yY][eE][sS])   ${PKG_ADD} -A ${STAGE_PKGFILE} ;;               \
-       *)              ${PKG_ADD} ${STAGE_PKGFILE} ;;                  \
+       [yY][eE][sS])                                                           \
+               ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -A ${STAGE_PKGFILE} ;;     \
+       *)      ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} ${STAGE_PKGFILE} ;;        \
        esac
 .endif

Index: pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
diff -u pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.6 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.7
--- pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.6       Sun Apr 10 15:20:26 2016
+++ pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk   Sat Aug 19 00:30:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: pkgformat-vars.mk,v 1.6 2016/04/10 15:20:26 joerg Exp $
+# $NetBSD: pkgformat-vars.mk,v 1.7 2017/08/19 00:30:19 jlam Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -37,6 +37,11 @@ PKGTOOLS_REQD=               20100914
 # Latest version of pkg_install required to extract packages
 PKGTOOLS_VERSION_REQD= 20091115
 
+# Environment used when invoking package tools.  This is used to pass
+# environment variables to the package install and deinstall scripts.
+#
+PKGTOOLS_ENV?=         # empty
+
 .if !defined(PKGTOOLS_VERSION)
 PKGTOOLS_VERSION!=     ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302
 MAKEFLAGS+=            PKGTOOLS_VERSION=${PKGTOOLS_VERSION}

Index: pkgsrc/mk/pkgformat/pkg/replace.mk
diff -u pkgsrc/mk/pkgformat/pkg/replace.mk:1.4 pkgsrc/mk/pkgformat/pkg/replace.mk:1.5
--- pkgsrc/mk/pkgformat/pkg/replace.mk:1.4      Mon Sep 19 12:26:08 2016
+++ pkgsrc/mk/pkgformat/pkg/replace.mk  Sat Aug 19 00:30:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.4 2016/09/19 12:26:08 gdt Exp $
+# $NetBSD: replace.mk,v 1.5 2017/08/19 00:30:19 jlam Exp $
 #
 
 # _pkgformat-destdir-replace:
@@ -90,13 +90,13 @@ undo-replace-install: .PHONY
        @${PHASE_MSG} "Re-adding ${PKGNAME} from saved tar-up package."
        ${RUN} ${_REPLACE_OLDNAME_CMD};                                 \
        ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
-       ${PKG_ADD} ${WRKDIR}/$${oldname}${PKG_SUFX}
+       ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} ${WRKDIR}/$${oldname}${PKG_SUFX}
 
 undo-destdir-replace-install: .PHONY
        @${PHASE_MSG} "Re-adding ${PKGNAME} from saved tar-up package."
        ${RUN} ${_REPLACE_OLDNAME_CMD};                                 \
        ${ECHO} "Installing saved package ${WRKDIR}/$${oldname}${PKG_SUFX}"; \
-       ${PKG_ADD} -U -D ${WRKDIR}/$${oldname}${PKG_SUFX}
+       ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D ${WRKDIR}/$${oldname}${PKG_SUFX}
 
 # Computes and saves the full names of the installed package to be replaced
 # (oldname) and the package that will be installed (newname), so that these
@@ -202,12 +202,12 @@ replace-destdir: .PHONY
        @${PHASE_MSG} "Updating using binary package of "${PKGNAME:Q}
 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
        @${MKDIR} ${_CROSS_DESTDIR}${PREFIX}
-       ${PKG_ADD} -U -D -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE}
+       ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${STAGE_PKGFILE}
        @${ECHO} "Fixing recorded cwd..."
        @${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp
        @${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS
 .else
-       ${PKG_ADD} -U -D ${STAGE_PKGFILE}
+       ${SETENV} ${PKGTOOLS_ENV} ${PKG_ADD} -U -D ${STAGE_PKGFILE}
 .endif
        ${RUN}${_REPLACE_OLDNAME_CMD}; \
        ${PKG_INFO} -qR ${PKGNAME:Q} | while read pkg; do \



Home | Main Index | Thread Index | Old Index