diff options
author | wiz <wiz@pkgsrc.org> | 2014-12-30 15:13:19 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2014-12-30 15:13:19 +0000 |
commit | c847f599fae4c8f3ee0a5d8469a7564bab932fc0 (patch) | |
tree | 72a940b4201682de30eda8c9b0e307555f4681b7 /mk/pkginstall | |
parent | 48b9f0ffaecb6a61d5a3d0b56da4a0e13bf291c3 (diff) | |
download | pkgsrc-c847f599fae4c8f3ee0a5d8469a7564bab932fc0.tar.gz |
Remove pkg_views support, second part: infrastructure.
Diffstat (limited to 'mk/pkginstall')
-rw-r--r-- | mk/pkginstall/bsd.pkginstall.mk | 11 | ||||
-rw-r--r-- | mk/pkginstall/deinstall | 28 | ||||
-rw-r--r-- | mk/pkginstall/deinstall-pre | 15 | ||||
-rw-r--r-- | mk/pkginstall/files | 44 | ||||
-rw-r--r-- | mk/pkginstall/header | 15 | ||||
-rw-r--r-- | mk/pkginstall/install | 29 | ||||
-rw-r--r-- | mk/pkginstall/install-post | 15 |
7 files changed, 13 insertions, 144 deletions
diff --git a/mk/pkginstall/bsd.pkginstall.mk b/mk/pkginstall/bsd.pkginstall.mk index 408f1d6abfc..4fc096c66bf 100644 --- a/mk/pkginstall/bsd.pkginstall.mk +++ b/mk/pkginstall/bsd.pkginstall.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkginstall.mk,v 1.60 2014/10/12 23:44:32 joerg Exp $ +# $NetBSD: bsd.pkginstall.mk,v 1.61 2014/12/30 15:13:20 wiz Exp $ # # This Makefile fragment is included by bsd.pkg.mk and implements the # common INSTALL/DEINSTALL scripts framework. To use the pkginstall @@ -86,7 +86,6 @@ HEADER_TEMPLATES?= # empty empty(HEADER_TEMPLATES:M${PKGDIR}/HEADER) HEADER_TEMPLATES+= ${PKGDIR}/HEADER .endif -_DEINSTALL_PRE_TMPL?= ${.CURDIR}/../../mk/pkginstall/deinstall-pre DEINSTALL_TEMPLATES?= # empty .if exists(${PKGDIR}/DEINSTALL) && \ empty(DEINSTALL_TEMPLATES:M${PKGDIR}/DEINSTALL) @@ -100,7 +99,6 @@ INSTALL_TEMPLATES?= # empty empty(INSTALL_TEMPLATES:M${PKGDIR}/INSTALL) INSTALL_TEMPLATES+= ${PKGDIR}/INSTALL .endif -_INSTALL_POST_TMPL?= ${.CURDIR}/../../mk/pkginstall/install-post _INSTALL_DATA_TMPL?= # empty _FOOTER_TMPL?= ${.CURDIR}/../../mk/pkginstall/footer @@ -112,7 +110,6 @@ _FOOTER_TMPL?= ${.CURDIR}/../../mk/pkginstall/footer # template files minus any user-supplied templates. # _DEINSTALL_TEMPLATES= ${_HEADER_TMPL} ${HEADER_TEMPLATES} \ - ${_DEINSTALL_PRE_TMPL} \ ${DEINSTALL_TEMPLATES} \ ${_DEINSTALL_TMPL} \ ${_FOOTER_TMPL} @@ -120,17 +117,14 @@ _INSTALL_TEMPLATES= ${_HEADER_TMPL} ${HEADER_TEMPLATES} \ ${_INSTALL_UNPACK_TMPL} \ ${_INSTALL_TMPL} \ ${INSTALL_TEMPLATES} \ - ${_INSTALL_POST_TMPL} \ ${_FOOTER_TMPL} \ ${_INSTALL_DATA_TMPL} \ _DEINSTALL_TEMPLATES_DFLT= ${_HEADER_TMPL} \ - ${_DEINSTALL_PRE_TMPL} \ ${_DEINSTALL_TMPL} \ ${_FOOTER_TMPL} _INSTALL_TEMPLATES_DFLT= ${_HEADER_TMPL} \ ${_INSTALL_TMPL} \ - ${_INSTALL_POST_TMPL} \ ${_FOOTER_TMPL} # These are the list of source files that are concatenated to form the @@ -145,15 +139,12 @@ INSTALL_SRC?= ${_INSTALL_TEMPLATES} FILES_SUBST+= PREFIX=${PREFIX:Q} FILES_SUBST+= LOCALBASE=${LOCALBASE:Q} FILES_SUBST+= X11BASE=${X11BASE:Q} -FILES_SUBST+= DEPOTBASE=${DEPOTBASE:Q} FILES_SUBST+= VARBASE=${VARBASE:Q} FILES_SUBST+= PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q} -FILES_SUBST+= PKG_SYSCONFDEPOTBASE=${PKG_SYSCONFDEPOTBASE:Q} FILES_SUBST+= PKG_SYSCONFBASEDIR=${PKG_SYSCONFBASEDIR:Q} FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q} FILES_SUBST+= CONF_DEPENDS=${CONF_DEPENDS:C/:.*//:Q} FILES_SUBST+= PKGBASE=${PKGBASE:Q} -FILES_SUBST+= PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE:Q} # PKG_USERS represents the users to create for the package. It is a # space-separated list of elements of the form diff --git a/mk/pkginstall/deinstall b/mk/pkginstall/deinstall index 28d7ef2e744..6fd7f05693f 100644 --- a/mk/pkginstall/deinstall +++ b/mk/pkginstall/deinstall @@ -1,22 +1,7 @@ -# $NetBSD: deinstall,v 1.2 2007/07/18 18:01:03 jlam Exp $ +# $NetBSD: deinstall,v 1.3 2014/12/30 15:13:20 wiz Exp $ case ${STAGE} in -VIEW-DEINSTALL) - case ${_PKG_CONFIG} in - yes) - case ${PKG_SYSCONFDEPOTBASE} in - "") - ${TEST} ! -x ./+FILES || - ./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX} - ;; - *) - ${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \ - ${LINKFARM} -D -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME} - ${RMDIR} -p ${PKG_SYSCONFVIEWBASE} 2>/dev/null || ${TRUE} - ;; - esac - ;; - esac +DEINSTALL) # # Unregister info files. # @@ -29,9 +14,7 @@ VIEW-DEINSTALL) ./+SHELL REMOVE ${PKG_METADATA_DIR} ${TEST} ! -x ./+SHELL || ./+SHELL CHECK-REMOVE ${PKG_METADATA_DIR} - ;; -DEINSTALL) # Remove configuration files if they don't differ from the default # config file. # @@ -40,13 +23,6 @@ DEINSTALL) ;; POST-DEINSTALL) - if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \ - "${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then - if [ -h ${PKG_SYSCONFDIR} ]; then - ${RM} -f ${PKG_SYSCONFDIR} - fi - ${RMDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` 2>/dev/null || ${TRUE} - fi # # Update any fonts databases. # diff --git a/mk/pkginstall/deinstall-pre b/mk/pkginstall/deinstall-pre deleted file mode 100644 index 679374c7e13..00000000000 --- a/mk/pkginstall/deinstall-pre +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: deinstall-pre,v 1.1 2006/05/21 23:50:15 jlam Exp $ - -# Ensure that the VIEW-DEINSTALL action is called for overwrite packages. -# This is here to ensure that it's the first DEINSTALL action (before -# any DEINSTALL_TEMPLATE DEINSTALL actions). -# -case ${STAGE} in -DEINSTALL) - if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then - ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \ - $0 ${PKGNAME} VIEW-DEINSTALL - fi - ;; -esac - diff --git a/mk/pkginstall/files b/mk/pkginstall/files index 6761966e2db..edbb666f3c3 100644 --- a/mk/pkginstall/files +++ b/mk/pkginstall/files @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.8 2012/04/21 10:22:32 wiz Exp $ +# $NetBSD: files,v 1.9 2014/12/30 15:13:20 wiz Exp $ # # Generate a +FILES script that reference counts config files that are # required for the proper functioning of the package. @@ -11,7 +11,6 @@ UNPACK,|UNPACK,+FILES) # +FILES - reference-counted configuration file management script # # Usage: ./+FILES ADD|REMOVE|PERMS [metadatadir] -# ./+FILES VIEW-REMOVE depotdir viewdir # ./+FILES CHECK-ADD|CHECK-REMOVE|CHECK-PERMS [metadatadir] # # This script supports two actions, ADD and REMOVE, that will add or @@ -22,8 +21,7 @@ UNPACK,|UNPACK,+FILES) # any files needed by the package still exist, and print an informative # message noting those files. The CHECK-ADD and CHECK-REMOVE actions # return non-zero if they detect either missing or existing files, -# respectively. The VIEW-REMOVE action will remove from <viewdir> the -# links to the configuration files in <depotdir>. The PERMS action +# respectively. The PERMS action # will correct any ownership or permission discrepancies between the # existing files and the data in this script, and the CHECK-PERMS # action will check whether any files have the wrong ownership or @@ -98,21 +96,12 @@ case "${PKG_RCD_SCRIPTS:-@PKG_RCD_SCRIPTS@}" in ;; esac -case $ACTION in -VIEW-REMOVE) - DEPOTDIR="$2" - VIEWDIR="$3" - ${TEST} -n "${DEPOTDIR}" -a -n "${VIEWDIR}" || exit 0 - ;; -*) - CURDIR=`${PWD_CMD}` - PKG_METADATA_DIR="${2-${CURDIR}}" - : ${PKGNAME=${PKG_METADATA_DIR##*/}} - : ${PKG_DBDIR=${PKG_METADATA_DIR%/*}} - : ${PKG_REFCOUNT_DBDIR=${PKG_DBDIR}.refcount} - PKG_REFCOUNT_FILES_DBDIR="${PKG_REFCOUNT_DBDIR}/files" - ;; -esac +CURDIR=`${PWD_CMD}` +PKG_METADATA_DIR="${2-${CURDIR}}" +: ${PKGNAME=${PKG_METADATA_DIR##*/}} +: ${PKG_DBDIR=${PKG_METADATA_DIR%/*}} +: ${PKG_REFCOUNT_DBDIR=${PKG_DBDIR}.refcount} +PKG_REFCOUNT_FILES_DBDIR="${PKG_REFCOUNT_DBDIR}/files" exitcode=0 case $ACTION in @@ -254,22 +243,6 @@ PERMS) done ;; -VIEW-REMOVE) - ${SED} -n "/^\# FILE: /{s/^\# FILE: //;p;}" ${SELF} | ${SORT} -ru | - while read file f_flags f_eg f_mode f_user f_group; do - case $file in - ${DEPOTDIR}/*) link="${VIEWDIR}/${file#${DEPOTDIR}/}" ;; - [!/]*) link="${VIEWDIR}/$file" ;; - *) continue ;; - esac - dir="${link%[^/]*}" - if ${TEST} -h "$link"; then - ${RM} -f $link - ${RMDIR} -p $dir 2>/dev/null || ${TRUE} - fi - done - ;; - CHECK-ADD) ${SED} -n "/^\# FILE: /{s/^\# FILE: //;p;}" ${SELF} | ${SORT} -ru | { while read file f_flags f_eg f_mode f_user f_group; do @@ -431,7 +404,6 @@ CHECK-PERMS) *) ${ECHO} "Usage: ./+FILES ADD|REMOVE|PERMS [metadatadir]" - ${ECHO} " ./+FILES VIEW-REMOVE depotdir viewdir" ${ECHO} " ./+FILES CHECK-ADD|CHECK-REMOVE|CHECK-PERMS [metadatadir]" ;; esac diff --git a/mk/pkginstall/header b/mk/pkginstall/header index 42bdc29f624..1a270cd0ea9 100644 --- a/mk/pkginstall/header +++ b/mk/pkginstall/header @@ -1,6 +1,6 @@ #!@SH@ # -# $NetBSD: header,v 1.2 2006/07/19 22:26:26 jlam Exp $ +# $NetBSD: header,v 1.3 2014/12/30 15:13:20 wiz Exp $ SELF="$0" PKGNAME="$1" @@ -54,28 +54,15 @@ PKGBASE="@PKGBASE@" LOCALBASE="@LOCALBASE@" X11BASE="@X11BASE@" -DEPOTBASE="@DEPOTBASE@" PREFIX="@PREFIX@" -case ${PKG_PREFIX} in -${LOCALBASE}/*) VIEW="${PKG_PREFIX#${LOCALBASE}/}" ;; -*) VIEW="" ;; -esac PKG_SYSCONFBASE="@PKG_SYSCONFBASE@" -PKG_SYSCONFDEPOTBASE="@PKG_SYSCONFDEPOTBASE@" PKG_SYSCONFBASEDIR="@PKG_SYSCONFBASEDIR@" PKG_SYSCONFDIR="@PKG_SYSCONFDIR@" CONF_DEPENDS="@CONF_DEPENDS@" -case ${VIEW} in -"") PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}" ;; -*) PKG_SYSCONFVIEWBASE="${PKG_SYSCONFBASE}/${VIEW}" ;; -esac - CONF_IGNORE_FILES="*[~#] *.OLD *.orig *,v .pkgsrc */.pkgsrc" -PKG_INSTALLATION_TYPE="@PKG_INSTALLATION_TYPE@" - case "${PKG_CONFIG:-@PKG_CONFIG@}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) _PKG_CONFIG=yes diff --git a/mk/pkginstall/install b/mk/pkginstall/install index 45c79319db4..598cec620c3 100644 --- a/mk/pkginstall/install +++ b/mk/pkginstall/install @@ -1,4 +1,4 @@ -# $NetBSD: install,v 1.2 2007/07/18 18:01:03 jlam Exp $ +# $NetBSD: install,v 1.3 2014/12/30 15:13:20 wiz Exp $ case ${STAGE} in PRE-INSTALL) @@ -17,23 +17,6 @@ PRE-INSTALL) else exit 1 fi; } - # - # Create package directories at pre-install time. - # - if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \ - "${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then - pkg=`${PKG_ADMIN} -b -d ${DEPOTBASE} -s "" lsbest "${CONF_DEPENDS}"` - sysconfdir=`${PKG_INFO} -B -K ${DEPOTBASE} $pkg | \ - ${AWK} '/^PKG_SYSCONFDIR=/ { \ - gsub("^PKG_SYSCONFDIR=[ ]*", ""); \ - print; \ - }' \ - ` - if [ -d $sysconfdir -a ! -d ${PKG_SYSCONFDIR} ]; then - ${MKDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` - ${LN} -sf $sysconfdir ${PKG_SYSCONFDIR} - fi - fi ${TEST} ! -x ./+DIRS || ./+DIRS ADD ${PKG_METADATA_DIR} ${TEST} ! -x ./+DIRS || @@ -74,9 +57,7 @@ POST-INSTALL) ./+FILES CHECK-ADD ${PKG_METADATA_DIR} ${TEST} ! -x ./+FILES || ./+FILES CHECK-PERMS ${PKG_METADATA_DIR} - ;; -VIEW-INSTALL) # # Register shells in /etc/shells. # @@ -89,14 +70,6 @@ VIEW-INSTALL) # ${TEST} ! -x ./+INFO_FILES || ./+INFO_FILES ADD ${PKG_METADATA_DIR} - - # If ${PKG_SYSCONFBASE} points outside of ${PREFIX}, then add the - # package config files to the proper view. - # - if [ "${_PKG_CONFIG}" = "yes" -a -n "${PKG_SYSCONFDEPOTBASE}" ]; then - ${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \ - ${LINKFARM} -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME} - fi ;; esac diff --git a/mk/pkginstall/install-post b/mk/pkginstall/install-post deleted file mode 100644 index 2e2ea84fd3a..00000000000 --- a/mk/pkginstall/install-post +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: install-post,v 1.1 2006/05/21 23:50:15 jlam Exp $ - -# Ensure that the VIEW-INSTALL action is called for overwrite packages. -# This is here to ensure that it's the final POST-INSTALL action (after -# any INSTALL_TEMPLATE POST-INSTALL actions). -# -case ${STAGE} in -POST-INSTALL) - if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then - ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \ - $0 ${PKGNAME} VIEW-INSTALL - fi - ;; -esac - |