From owner-svn-ports-head@freebsd.org Sun Jun 19 11:25:40 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE6FDA7AC07; Sun, 19 Jun 2016 11:25:40 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAA3E1D55; Sun, 19 Jun 2016 11:25:40 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5JBPd0x050369; Sun, 19 Jun 2016 11:25:39 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5JBPdTV050367; Sun, 19 Jun 2016 11:25:39 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201606191125.u5JBPdTV050367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Sun, 19 Jun 2016 11:25:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r417112 - in head/Mk: . Scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 11:25:41 -0000 Author: mat Date: Sun Jun 19 11:25:39 2016 New Revision: 417112 URL: https://svnweb.freebsd.org/changeset/ports/417112 Log: Extract create-manifest. PR: 210198 Submitted by: mat Exp-run by: antoine Sponsored by: The FreeBSD Foundation, Absolight Differential Revision: https://reviews.freebsd.org/D6779 Added: head/Mk/Scripts/create-manifest.sh (contents, props changed) Modified: head/Mk/bsd.port.mk (contents, props changed) Added: head/Mk/Scripts/create-manifest.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Scripts/create-manifest.sh Sun Jun 19 11:25:39 2016 (r417112) @@ -0,0 +1,148 @@ +#!/bin/sh +# $FreeBSD$ +# +# MAINTAINER: portmgr@FreeBSD.org + +set -e + +. "${dp_SCRIPTSDIR}/functions.sh" + +validate_env dp_ACTUAL_PACKAGE_DEPENDS dp_CATEGORIES dp_COMMENT \ + dp_COMPLETE_OPTIONS_LIST dp_DEPRECATED dp_DESCR dp_EXPIRATION_DATE \ + dp_GROUPS dp_LICENSE dp_LICENSE_COMB dp_MAINTAINER dp_METADIR \ + dp_NO_ARCH dp_PKGBASE dp_PKGDEINSTALL dp_PKGINSTALL dp_PKGMESSAGE \ + dp_PKGORIGIN dp_PKGPOSTDEINSTALL dp_PKGPOSTINSTALL dp_PKGPOSTUPGRADE \ + dp_PKGPREDEINSTALL dp_PKGPREINSTALL dp_PKGPREUPGRADE dp_PKGUPGRADE \ + dp_PKGVERSION dp_PKG_BIN dp_PKG_IGNORE_DEPENDS dp_PKG_NOTES \ + dp_PORT_OPTIONS dp_PREFIX dp_USERS dp_WWW + +[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_CREATE_MANIFEST}" ] && set -x + +set -u + +listcontains() { + local str lst elt + str=$1 + lst=$2 + + for elt in ${lst} ; do + if [ ${elt} = ${str} ]; then + return 0 + fi + done + return 1 +} + +mkdir -p ${dp_METADIR} + +# Save stdout and redirect it to the manifest file. +exec 3>&1 >${dp_METADIR}/+MANIFEST + +# First, all the required bits +cat <> ${output} + done + done +done + +# *** STARTING NOW, STDOUT is +DISPLAY *** + +exec >${dp_METADIR}/+DISPLAY + +[ -f ${dp_PKGMESSAGE} ] && cat ${dp_PKGMESSAGE} + +# Try and keep these messages in sync with check-deprecated +if [ ${dp_MAINTAINER} = "ports@FreeBSD.org" ]; then + if [ -f "${dp_METADIR}/+DISPLAY" ]; then echo; fi + cat <<-EOT + ===> NOTICE: + + The ${dp_PKGBASE} port currently does not have a maintainer. As a result, it is + more likely to have unresolved issues, not be up-to-date, or even be removed in + the future. To volunteer to maintain this port, please create an issue at: + + https://bugs.freebsd.org/bugzilla + + More information about port maintainership is available at: + + https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port + EOT +fi + +if [ -n "${dp_DEPRECATED}" ]; then + if [ -f "${dp_METADIR}/+DISPLAY" ]; then echo; fi + cat <<-EOT + ===> NOTICE: + + This port is deprecated; you may wish to reconsider installing it: + + ${dp_DEPRECATED}. + + EOT + + if [ -n "${dp_EXPIRATION_DATE}" ]; then + cat <<-EOT + It is scheduled to be removed on or after ${dp_EXPIRATION_DATE}. + + EOT + fi +fi + +if [ ! -s ${dp_METADIR}/+DISPLAY ]; then + rm -f ${dp_METADIR}/+DISPLAY +fi Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Sun Jun 19 11:25:35 2016 (r417111) +++ head/Mk/bsd.port.mk Sun Jun 19 11:25:39 2016 (r417112) @@ -1862,7 +1862,6 @@ CO_ENV+= NO_PREFIX_RMDIR=0 METADIR= ${WRKDIR}/.metadir -MANIFESTF= ${METADIR}/+MANIFEST PKGPREINSTALL?= ${PKGDIR}/pkg-pre-install PKGPOSTINSTALL?= ${PKGDIR}/pkg-post-install @@ -2968,7 +2967,7 @@ ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRA # Warn user about deprecated packages. Advisory only. .if !target(check-deprecated) -# Try and keep these messages in sync with the ones in create-manifest +# Try and keep these messages in sync with the ones in Mk/Scripts/create-manifest.sh check-deprecated: .if ${MAINTAINER} == "ports@FreeBSD.org" @${ECHO_MSG} "===> NOTICE:" @@ -4211,99 +4210,49 @@ ACTUAL-PACKAGE-DEPENDS?= \ done ; \ ${SETENV} PKG_BIN="${PKG_BIN}" ${SH} ${SCRIPTSDIR}/actual-package-depends.sh $${depfiles} ${RUN_DEPENDS:C/(.*)\:.*/"\1"/} -create-manifest: - @${MKDIR} ${METADIR}; \ - (\ - echo "name: \"${PKGBASE}\"" ; \ - echo "version: \"${PKGVERSION}\"" ; \ - echo "origin: ${PKGORIGIN}" ; \ - echo "comment: < ${MANIFESTF} - @${ECHO_CMD} -n "options: {" >> ${MANIFESTF} -.for opt in ${COMPLETE_OPTIONS_LIST} - @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}: $${match:-off}," >> ${MANIFESTF} -.endfor - @${ECHO_CMD} "}" >> ${MANIFESTF} -.if defined(PKG_NOTES) - @${ECHO_CMD} -n "annotations: {" >> ${MANIFESTF} +PKG_NOTES_ENV?= .for note in ${PKG_NOTES} - @${ECHO_CMD} -n ' ${note}: "${PKG_NOTE_${note}:S/"/\"/g}",' >> ${MANIFESTF} +PKG_NOTES_ENV+= dp_PKG_NOTE_${note}=${PKG_NOTE_${note}:Q} .endfor - @${ECHO_CMD} " }" >> ${MANIFESTF} -.endif - @[ -f ${PKGINSTALL} ] && ${CP} ${PKGINSTALL} ${METADIR}/+INSTALL; \ - ${RM} -f ${METADIR}/+PRE_INSTALL ; \ - for a in ${PKGPREINSTALL}; do \ - [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_INSTALL ; \ - done ; \ - ${RM} -f ${METADIR}/+POST_INSTALL ; \ - for a in ${PKGPOSTINSTALL}; do \ - [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_INSTALL ; \ - done ; \ - [ -f ${PKGDEINSTALL} ] && ${CP} ${PKGDEINSTALL} ${METADIR}/+DEINSTALL; \ - ${RM} -f ${METADIR}/+PRE_DEINSTALL ; \ - for a in ${PKGPREDEINSTALL}; do \ - [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+PRE_DEINSTALL ; \ - done ; \ - ${RM} -f ${METADIR}/+POST_DEINSTALL ; \ - for a in ${PKGPOSTDEINSTALL}; do \ - [ -f $$a ] && ${CAT} $$a >> ${METADIR}/+POST_DEINSTALL ; \ - done ; \ - [ -f ${PKGUPGRADE} ] && ${CP} ${PKGUPGRADE} ${METADIR}/+UPGRADE; \ - [ -f ${PKGPREUPGRADE} ] && ${CP} ${PKGPREUPGRADE} ${METADIR}/+PRE_UPGRADE; \ - [ -f ${PKGPOSTUPGRADE} ] && ${CP} ${PKGPOSTUPGRADE} ${METADIR}/+POST_UPGRADE; \ - ${CP} ${DESCR} ${METADIR}/+DESC; \ - [ -f ${PKGMESSAGE} ] && ${CP} ${PKGMESSAGE} ${METADIR}/+DISPLAY || return 0 -# Try and keep these messages in sync with check-deprecated -.if ${MAINTAINER} == "ports@FreeBSD.org" - @( \ - if [ -f "${METADIR}/+DISPLAY" ]; then ${ECHO_CMD}; fi; \ - ${ECHO_CMD} "===> NOTICE:"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} "The ${PORTNAME} port currently does not have a maintainer. As a result, it is"; \ - ${ECHO_CMD} "more likely to have unresolved issues, not be up-to-date, or even be removed in"; \ - ${ECHO_CMD} "the future. To volunteer to maintain this port, please create an issue at:"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} "https://bugs.freebsd.org/bugzilla"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} "More information about port maintainership is available at:"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} "https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port"; \ - ) >> ${METADIR}/+DISPLAY -.endif -.if defined(DEPRECATED) - @( \ - if [ -f "${METADIR}/+DISPLAY" ]; then ${ECHO_CMD}; fi; \ - ${ECHO_CMD} "===> NOTICE:"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} "This port is deprecated; you may wish to reconsider installing it:"; \ - ${ECHO_CMD}; \ - ${ECHO_CMD} ${DEPRECATED:Q}.; \ - ${ECHO_CMD}; \ - ) >> ${METADIR}/+DISPLAY -.if defined(EXPIRATION_DATE) - @( \ - ${ECHO_CMD} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."; \ - ${ECHO_CMD}; \ - ) >> ${METADIR}/+DISPLAY -.endif -.endif + +create-manifest: + @${SETENV} \ + dp_SCRIPTSDIR='${SCRIPTSDIR}' \ + dp_ACTUAL_PACKAGE_DEPENDS='${ACTUAL-PACKAGE-DEPENDS}' \ + dp_CATEGORIES='${CATEGORIES:u:S/$/,/}' \ + dp_COMMENT=${COMMENT:Q} \ + dp_COMPLETE_OPTIONS_LIST='${COMPLETE_OPTIONS_LIST}' \ + dp_DEPRECATED='${DEPRECATED:Q}' \ + dp_DESCR='${DESCR}' \ + dp_EXPIRATION_DATE='${EXPIRATION_DATE}' \ + dp_GROUPS='${GROUPS:u:S/$/,/}' \ + dp_LICENSE='${LICENSE:u:S/$/,/}' \ + dp_LICENSE_COMB='${LICENSE_COMB}' \ + dp_MAINTAINER='${MAINTAINER}' \ + dp_METADIR='${METADIR}' \ + dp_NO_ARCH='${NO_ARCH}' \ + dp_PKGBASE='${PKGBASE}' \ + dp_PKGDEINSTALL='${PKGDEINSTALL}' \ + dp_PKGINSTALL='${PKGINSTALL}' \ + dp_PKGMESSAGE='${PKGMESSAGE}' \ + dp_PKGORIGIN='${PKGORIGIN}' \ + dp_PKGPOSTDEINSTALL='${PKGPOSTDEINSTALL}' \ + dp_PKGPOSTINSTALL='${PKGPOSTINSTALL}' \ + dp_PKGPOSTUPGRADE='${PKGPOSTUPGRADE}' \ + dp_PKGPREDEINSTALL='${PKGPREDEINSTALL}' \ + dp_PKGPREINSTALL='${PKGPREINSTALL}' \ + dp_PKGPREUPGRADE='${PKGPREUPGRADE}' \ + dp_PKGUPGRADE='${PKGUPGRADE}' \ + dp_PKGVERSION='${PKGVERSION}' \ + dp_PKG_BIN='${PKG_BIN}' \ + dp_PKG_IGNORE_DEPENDS='${PKG_IGNORE_DEPENDS}' \ + dp_PKG_NOTES='${PKG_NOTES}' \ + dp_PORT_OPTIONS='${PORT_OPTIONS}' \ + dp_PREFIX='${PREFIX}' \ + dp_USERS='${USERS:u:S/$/,/}' \ + dp_WWW='${WWW}' \ + ${PKG_NOTES_ENV} \ + ${SH} ${SCRIPTSDIR}/create-manifest.sh # Print out package names.