diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2019-06-03 12:57:44 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2019-06-03 12:57:44 +0000 |
commit | bd94d2c38d67581f48a8fca462aea68821e4351e (patch) | |
tree | 9affe9a0e3a31001d4d6a9d2af18f699dc96d038 /Mk/Scripts | |
parent | - Update to 0.9.6.10 [1] (diff) |
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 = <<EOD
formatted
message 'with fancy things'
EOD
},
}
Submitted by: bapt
Reviewed by: bapt, mat
Differential Revision: https://reviews.freebsd.org/D19310
Notes
Notes:
svn path=/head/; revision=503385
Diffstat (limited to 'Mk/Scripts')
-rw-r--r-- | Mk/Scripts/create-manifest.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Mk/Scripts/create-manifest.sh b/Mk/Scripts/create-manifest.sh index 974198cf7928..9646045987af 100644 --- a/Mk/Scripts/create-manifest.sh +++ b/Mk/Scripts/create-manifest.sh @@ -112,14 +112,24 @@ done exec >${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=<<EOD' + cat "${message}" + printf 'EOD\n},\n' + fi + fi done # 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 + { message=<<EOD ===> 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=<<EOD ===> 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 ']' |