git: 1c57bbff5e0e - main - textproc/consul-template: Update to 0.27.2

From: Brad Davis <brd_at_FreeBSD.org>
Date: Thu, 30 Dec 2021 01:48:17 UTC
The branch main has been updated by brd (doc, src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=1c57bbff5e0e63788c0dc83c07109ef5324d75aa

commit 1c57bbff5e0e63788c0dc83c07109ef5324d75aa
Author:     Boris Korzun <drtr0jan@yandex.ru>
AuthorDate: 2021-12-30 01:44:36 +0000
Commit:     Brad Davis <brd@FreeBSD.org>
CommitDate: 2021-12-30 01:47:42 +0000

    textproc/consul-template: Update to 0.27.2
    
    1) Update to 0.27.2:
    * syslog bug fixed - https://github.com/hashicorp/consul-template/issues/1523
    
    2) RC-script refactor:
    * fixed keyword;
    * added consul_template_syslog_output_tag variable, making them consistent with the rest of the ports tree;
    * fixed codestyle.
    
    PR: 259711
---
 textproc/consul-template/Makefile                 | 12 ++---
 textproc/consul-template/distinfo                 | 18 +++----
 textproc/consul-template/files/consul-template.in | 58 ++++++++++++-----------
 3 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/textproc/consul-template/Makefile b/textproc/consul-template/Makefile
index f7f660b701cf..955bc85debb4 100644
--- a/textproc/consul-template/Makefile
+++ b/textproc/consul-template/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	consul-template
-PORTVERSION=	0.27.1
+PORTVERSION=	0.27.2
 DISTVERSIONPREFIX=	v
 CATEGORIES=	textproc
 
@@ -18,10 +18,10 @@ GH_TUPLE=	hashicorp:${PORTNAME}:${DISTVERSIONPREFIX}${PORTVERSION}:DEFAULT/src/g
 		davecgh:go-spew:v1.1.1:davecgh_go_spew/vendor/github.com/davecgh/go-spew \
 		fatih:color:v1.9.0:fatih_color/vendor/github.com/fatih/color \
 		go-yaml:yaml:v2.3.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
-		golang:crypto:7f63de1d35b0:golang_crypto/vendor/golang.org/x/crypto \
-		golang:net:0a1ea396d57c:golang_net/vendor/golang.org/x/net \
+		golang:crypto:32db794688a5:golang_crypto/vendor/golang.org/x/crypto \
+		golang:net:e18ecbb05110:golang_net/vendor/golang.org/x/net \
 		golang:snappy:v0.0.2:golang_snappy/vendor/github.com/golang/snappy \
-		golang:sys:fdedc70b468f:golang_sys/vendor/golang.org/x/sys \
+		golang:sys:665e8c7367d1:golang_sys/vendor/golang.org/x/sys \
 		golang:text:v0.3.3:golang_text/vendor/golang.org/x/text \
 		golang:time:3af7569d3a1e:golang_time/vendor/golang.org/x/time \
 		hashicorp:consul:v0.4.1:hashicorp_consul_sdk/vendor/github.com/hashicorp/consul/sdk \
@@ -58,13 +58,13 @@ GH_TUPLE=	hashicorp:${PORTNAME}:${DISTVERSIONPREFIX}${PORTVERSION}:DEFAULT/src/g
 		square:go-jose:v2.5.1:square_go_jose/vendor/gopkg.in/square/go-jose.v2 \
 		stretchr:testify:v1.4.0:stretchr_testify/vendor/github.com/stretchr/testify
 
+USE_RC_SUBR=	consul-template
+
 GO_BUILDFLAGS=	-ldflags='\
 		-s -w -X github.com/hashicorp/consul-template/version.Name=${PORTNAME} \
 		-X github.com/hashicorp/consul-template/version.GitCommit=release'
 PLIST_FILES=	bin/consul-template
 
-USE_RC_SUBR=	consul-template
-
 post-extract:
 	@${RM} -r ${WRKSRC}/vendor/github.com/hashicorp/vault/api
 	@${RLN} ${WRKSRC_hashicorp_vault_api}/api ${WRKSRC}/vendor/github.com/hashicorp/vault/api
diff --git a/textproc/consul-template/distinfo b/textproc/consul-template/distinfo
index 3a6c78800594..1c3d1370d230 100644
--- a/textproc/consul-template/distinfo
+++ b/textproc/consul-template/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1633294992
-SHA256 (hashicorp-consul-template-v0.27.1_GH0.tar.gz) = 030c718e30ee31705469aa108269c8328c6e1bff6f104914093bc02d07d017e1
-SIZE (hashicorp-consul-template-v0.27.1_GH0.tar.gz) = 214559
+TIMESTAMP = 1636372533
+SHA256 (hashicorp-consul-template-v0.27.2_GH0.tar.gz) = d2130136d79df0452d01273df9568c28154a181d408fe5e4b39da78ce4e5a14f
+SIZE (hashicorp-consul-template-v0.27.2_GH0.tar.gz) = 215052
 SHA256 (BurntSushi-toml-v0.3.1_GH0.tar.gz) = 6593da894578ba510a470735ffbdc88ce88033094dc5a8f4d3957ab87e18803f
 SIZE (BurntSushi-toml-v0.3.1_GH0.tar.gz) = 42077
 SHA256 (armon-go-metrics-v0.3.4_GH0.tar.gz) = 43a08b6e237c2b82299750bee2b926987ee4140dfe0e8df43b0222b3283010ab
@@ -11,14 +11,14 @@ SHA256 (fatih-color-v1.9.0_GH0.tar.gz) = f5a6372ff7c87d22baaa2089e5cdd8a218fb3a9
 SIZE (fatih-color-v1.9.0_GH0.tar.gz) = 1230941
 SHA256 (go-yaml-yaml-v2.3.0_GH0.tar.gz) = 42027002bf258009d498600b04b8c9cbb29d2193185ea7bfa8fefe194fe72a07
 SIZE (go-yaml-yaml-v2.3.0_GH0.tar.gz) = 72816
-SHA256 (golang-crypto-7f63de1d35b0_GH0.tar.gz) = 2d1bcc81ecd06b9d92ede3fc186c9d81cafa2aecba920d61981f2a0ec6153da3
-SIZE (golang-crypto-7f63de1d35b0_GH0.tar.gz) = 1732554
-SHA256 (golang-net-0a1ea396d57c_GH0.tar.gz) = cf4c4eace915abf78de6408f4825230840601c5956580c38e8398732eca6e487
-SIZE (golang-net-0a1ea396d57c_GH0.tar.gz) = 1178838
+SHA256 (golang-crypto-32db794688a5_GH0.tar.gz) = c971927593630ecfa6531da54a579bf04186c354e365975cd86ea0e4c2c82fb7
+SIZE (golang-crypto-32db794688a5_GH0.tar.gz) = 1732714
+SHA256 (golang-net-e18ecbb05110_GH0.tar.gz) = c30374f6fd34c6b77d53224aa3ba7458e3773d7e6e4fa16d88fb05c7d05e0e89
+SIZE (golang-net-e18ecbb05110_GH0.tar.gz) = 1253124
 SHA256 (golang-snappy-v0.0.2_GH0.tar.gz) = 1807e65db2cf6b03eb7d16345ce31c82e66d178828b588aafcf7fa162483de8d
 SIZE (golang-snappy-v0.0.2_GH0.tar.gz) = 65973
-SHA256 (golang-sys-fdedc70b468f_GH0.tar.gz) = dbb02cdcafaa32d9d2cd0c16b7204fbb044512bc38814cb1ee5673a9ab2f2929
-SIZE (golang-sys-fdedc70b468f_GH0.tar.gz) = 1064136
+SHA256 (golang-sys-665e8c7367d1_GH0.tar.gz) = 19c3498496d91ac9c0c0226c9b832c23a0b042b9a707be811ef976e801d373f4
+SIZE (golang-sys-665e8c7367d1_GH0.tar.gz) = 1200405
 SHA256 (golang-text-v0.3.3_GH0.tar.gz) = 1604233637e3593749fbbb13b5069b08e6feba6d2b55a02fd3148793d5871185
 SIZE (golang-text-v0.3.3_GH0.tar.gz) = 7747332
 SHA256 (golang-time-3af7569d3a1e_GH0.tar.gz) = 93c79ee7ad72641dc5ebd47e6ecffa66e878e367ddbbef48208ff82a0b6fc7e0
diff --git a/textproc/consul-template/files/consul-template.in b/textproc/consul-template/files/consul-template.in
index e4d0d0b62982..e02a6267081e 100644
--- a/textproc/consul-template/files/consul-template.in
+++ b/textproc/consul-template/files/consul-template.in
@@ -2,27 +2,29 @@
 
 # PROVIDE: consul_template
 # REQUIRE: NETWORKING SERVERS DAEMON
-# KEYWORD: shtudown
+# KEYWORD: shutdown
 #
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
 # to enable this service:
 #
-# consul_template_enable (bool):        Set to NO by default.
-#                                          Set it to YES to enable consul-template.
-# consul_template_user (user):          Set user to run consul-template.
-#                                          Default is "root".
-# consul_template_group (group):        Set group to run consul-template.
-#                                          Default is "wheel".
-# consul_template_env (string):         Set environment variables used with consul-template.
-#                                          Default is "".
-# consul_template_args (string):        Set flags used with consul-template.
-#                                          Default is "".
-# consul_template_syslog_output_enable (string): Set to YES to enable syslog output
-#						Default is "NO". See daemon(8).
-# consul_template_syslog_output_priority (str):	Set syslog priority if syslog enabled.
-#						Default is "info". See daemon(8).
-# consul_template_syslog_output_facility (str):	Set syslog facility if syslog enabled.
-#						Default is "daemon". See daemon(8).
+# consul_template_enable (bool):			Set to NO by default.
+#							Set it to YES to enable consul-template.
+# consul_template_user (user):				Set user to run consul-template.
+#							Default is "root".
+# consul_template_group (group):			Set group to run consul-template.
+#							Default is "wheel".
+# consul_template_env (string):				Set environment variables used with consul-template.
+#							Default is "".
+# consul_template_args (string):			Set flags used with consul-template.
+#							Default is "".
+# consul_template_syslog_output_enable (string):	Set to YES to enable syslog output
+#							Default is "NO". See daemon(8).
+# consul_template_syslog_output_tag (str):		Set syslog tag if syslog enabled.
+#							Default is "consul-template". See daemon(8).
+# consul_template_syslog_output_priority (str):		Set syslog priority if syslog enabled.
+#							Default is "info". See daemon(8).
+# consul_template_syslog_output_facility (str):		Set syslog facility if syslog enabled.
+#							Default is "daemon". See daemon(8).
 
 . /etc/rc.subr
 
@@ -34,12 +36,16 @@ load_rc_config $name
 : ${consul_template_enable:="NO"}
 : ${consul_template_user:="root"}
 : ${consul_template_group:="wheel"}
-: ${consul_template_env:=""}
-: ${consul_template_args:=""}
 : ${consul_template_syslog_output_enable:="NO"}
 
+start_precmd="consul_template_start_precmd"
+
 if checkyesno consul_template_syslog_output_enable; then
-	consul_template_syslog_output_flags="-T ${name}"
+	if [ -n "${consul_template_syslog_output_tag}" ]; then
+		consul_template_syslog_output_flags="-T ${consul_template_syslog_output_tag}"
+	else
+		consul_template_syslog_output_flags="-T ${name}"
+	fi
 	if [ -n "${consul_template_syslog_output_priority}" ]; then
 		consul_template_syslog_output_flags="${consul_template_syslog_output_flags} -s ${consul_template_syslog_output_priority}"
 	fi
@@ -49,19 +55,17 @@ if checkyesno consul_template_syslog_output_enable; then
 	fi
 fi
 
-pidfile=/var/run/consul-template.pid
+pidfile="/var/run/consul-template.pid"
 procname="%%PREFIX%%/bin/consul-template"
 command="/usr/sbin/daemon"
 command_args="-f -t ${name} ${consul_template_syslog_output_flags} -p ${pidfile} /usr/bin/env ${consul_template_env} ${procname} -config=%%PREFIX%%/etc/consul-template.d ${consul_template_args}"
 sig_stop="INT"
 
-start_precmd=consul_template_startprecmd
-
-consul_template_startprecmd()
+consul_template_start_precmd()
 {
-    if [ ! -e ${pidfile} ]; then
-        install -o ${consul_template_user} -g ${consul_template_group} /dev/null ${pidfile}
-    fi
+	if [ ! -e ${pidfile} ]; then
+		install -m 0600 -o ${consul_template_user} -g ${consul_template_group} /dev/null "${pidfile}"
+	fi
 }
 
 run_rc_command "$1"