From owner-svn-ports-all@freebsd.org Mon Jun 3 12:57:45 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C1615B0757; Mon, 3 Jun 2019 12:57:45 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25E8276EBF; Mon, 3 Jun 2019 12:57:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA3516784; Mon, 3 Jun 2019 12:57:44 +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 x53CviVN092542; Mon, 3 Jun 2019 12:57:44 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53Cvi9P092541; Mon, 3 Jun 2019 12:57:44 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201906031257.x53Cvi9P092541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Mon, 3 Jun 2019 12:57:44 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503385 - head/Mk/Scripts X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: head/Mk/Scripts X-SVN-Commit-Revision: 503385 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25E8276EBF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 12:57:45 -0000 Author: mat Date: Mon Jun 3 12:57:44 2019 New Revision: 503385 URL: https://svnweb.freebsd.org/changeset/ports/503385 Log: Use UCL for pkg-message Remain backward compatible but use ucl for the pkg-messages, which allows to: - append messages one after the other - only print message on delete, install, upgrade from a version to another If pkg-message starts with a [ we consider it should be a valid ucl file The format is the following: [ { message: "Always print" }, { message: "package being removed", type: remove }, { message: "package being installed", type: install }, { message: "package is being upgraded", type: upgrade }, { message: "Upgrading from lower than 1.0", maximum_version: "1.0", type: upgrade }, { message: "Upgrading from higher than 1.0", minimum_version: "1.0", type: upgrade }, { message: "Upgrading from >1.0 < 3.0", maximum_version: "3.0", minimum_version: "1.0", ] Because it is ucl one can use some sugar like: [ { message = <${dp_METADIR}/+DISPLAY +echo '[' for message in ${dp_PKGMESSAGES}; do - [ -f "${message}" ] && cat "${message}" + if [ -f "${message}" ]; then + #if if starts with [ then it is ucl and we do drop last and first line + if head -1 "${message}" | grep -q '^\['; then + sed '1d;$d' "${message}" + else + echo '{message=< NOTICE: The ${dp_PKGBASE} port currently does not have a maintainer. As a result, it is @@ -131,12 +141,14 @@ if [ ${dp_MAINTAINER} = "ports@FreeBSD.org" ]; then More information about port maintainership is available at: https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port + EOD + }, EOT fi if [ -n "${dp_DEPRECATED}" ]; then - if [ -f "${dp_METADIR}/+DISPLAY" ]; then echo; fi cat <<-EOT + { message=< NOTICE: This port is deprecated; you may wish to reconsider installing it: @@ -151,8 +163,6 @@ if [ -n "${dp_DEPRECATED}" ]; then EOT fi + printf 'EOD\n},\n' fi - -if [ ! -s ${dp_METADIR}/+DISPLAY ]; then - rm -f ${dp_METADIR}/+DISPLAY -fi +echo ']'