public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-video/mjpg-streamer/files/
@ 2022-07-02 17:35 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2022-07-02 17:35 UTC (permalink / raw
  To: gentoo-commits

commit:     1a15764fea542d473a1abf67ccccd8fd5dee68d5
Author:     ChaosEngine <andrzej.pauli <AT> gmail <DOT> com>
AuthorDate: Sun Jun 12 15:38:23 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Jul  2 17:35:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a15764f

media-video/mjpg-streamer: fix init script's non-POSIX features

Closes: https://bugs.gentoo.org/848474
Signed-off-by: Andrzej Pauli ( <AT> ChaosEngine) <andrzej.pauli@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/25865
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-video/mjpg-streamer/files/mjpg-streamer.initd | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.initd b/media-video/mjpg-streamer/files/mjpg-streamer.initd
index e7116dba01d2..71da09faedf6 100644
--- a/media-video/mjpg-streamer/files/mjpg-streamer.initd
+++ b/media-video/mjpg-streamer/files/mjpg-streamer.initd
@@ -1,9 +1,9 @@
 #!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 MJPG_STREAMER_PIDFILE="${MJPG_STREAMER_PIDFILE:-/var/run/${SVCNAME}.pid}"
-MY_NAME=${SVCNAME//-/_}
+MY_NAME="${SVCNAME//-/_}"
 
 depend() {
 	use logger
@@ -13,13 +13,13 @@ depend() {
 checkconfig() {
 	local vars
 
-	[[ ${INPUT_PLUGIN} ]] || vars+=\ INPUT_PLUGIN
-	[[ ${OUTPUT_PLUGIN} ]] || vars+=\ OUTPUT_PLUGIN
-	[[ ${MJPG_STREAMER_USER} ]] || vars+=\ MJPG_STREAMER_USER
-	[[ ${MJPG_STREAMER_GROUP} ]] || vars+=\ MJPG_STREAMER_GROUP
+	[ "${INPUT_PLUGIN}" ] || vars+=\ INPUT_PLUGIN
+	[ "${OUTPUT_PLUGIN}" ] || vars+=\ OUTPUT_PLUGIN
+	[ "${MJPG_STREAMER_USER}" ] || vars+=\ MJPG_STREAMER_USER
+	[ "${MJPG_STREAMER_GROUP}" ] || vars+=\ MJPG_STREAMER_GROUP
 	vars="${vars# }"
 
-	if [[ ${vars} ]]; then
+	if [ "${vars}" ]; then
 		eerror "Required variables in /etc/conf.d/${SVCNAME} are not set:"
 		eerror "  ${vars// /, }"
 		return 1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-video/mjpg-streamer/files/
@ 2022-07-03  6:06 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2022-07-03  6:06 UTC (permalink / raw
  To: gentoo-commits

commit:     e565ecb9cc44e7af96faf0f1b50c2a5a142dc7ca
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jul  1 20:01:32 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 06:06:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e565ecb9

media-video/mjpg-streamer: Avoid non-POSIX features in runscript

Use [ rather than [[ (SC3010). Don't use += (SC3024). Don't use string
replacing forms of parameter expansion (SC3060); instead use tr(1).

Closes: https://bugs.gentoo.org/848474
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-video/mjpg-streamer/files/mjpg-streamer.initd | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.initd b/media-video/mjpg-streamer/files/mjpg-streamer.initd
index e7116dba01d2..3b307e777c94 100644
--- a/media-video/mjpg-streamer/files/mjpg-streamer.initd
+++ b/media-video/mjpg-streamer/files/mjpg-streamer.initd
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 MJPG_STREAMER_PIDFILE="${MJPG_STREAMER_PIDFILE:-/var/run/${SVCNAME}.pid}"
-MY_NAME=${SVCNAME//-/_}
+MY_NAME=$(printf %s "${SVCNAME}" | tr - _)
 
 depend() {
 	use logger
@@ -11,17 +11,16 @@ depend() {
 }
 
 checkconfig() {
-	local vars
+	set --
 
-	[[ ${INPUT_PLUGIN} ]] || vars+=\ INPUT_PLUGIN
-	[[ ${OUTPUT_PLUGIN} ]] || vars+=\ OUTPUT_PLUGIN
-	[[ ${MJPG_STREAMER_USER} ]] || vars+=\ MJPG_STREAMER_USER
-	[[ ${MJPG_STREAMER_GROUP} ]] || vars+=\ MJPG_STREAMER_GROUP
-	vars="${vars# }"
+	[ "${INPUT_PLUGIN}" ] || set -- "$@" INPUT_PLUGIN
+	[ "${OUTPUT_PLUGIN}" ] || set -- "$@" OUTPUT_PLUGIN
+	[ "${MJPG_STREAMER_USER}" ] || set -- "$@" MJPG_STREAMER_USER
+	[ "${MJPG_STREAMER_GROUP}" ] || set -- "$@" MJPG_STREAMER_GROUP
 
-	if [[ ${vars} ]]; then
+	if [ $# -gt 0 ]; then
 		eerror "Required variables in /etc/conf.d/${SVCNAME} are not set:"
-		eerror "  ${vars// /, }"
+		eerror " $(IFS=,; printf %s "$*")"
 		return 1
 	fi
 
@@ -31,7 +30,7 @@ checkconfig() {
 start() {
 	checkconfig || return $?
 	ebegin "Starting ${SVCNAME}"
-	start-stop-daemon --start --exec /usr/bin/${MY_NAME} \
+	start-stop-daemon --start --exec "/usr/bin/${MY_NAME}" \
 		--user "${MJPG_STREAMER_USER}" \
 		--group "${MJPG_STREAMER_GROUP}" -w 100 -b -m \
 		--pidfile "${MJPG_STREAMER_PIDFILE}" \
@@ -42,7 +41,7 @@ start() {
 
 stop() {
 	ebegin "Stopping ${SVCNAME}"
-	start-stop-daemon --stop --exec /usr/bin/${MY_NAME} \
+	start-stop-daemon --stop --exec "/usr/bin/${MY_NAME}" \
 		--pidfile "${MJPG_STREAMER_PIDFILE}"
 	eend $?
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-video/mjpg-streamer/files/
@ 2022-07-03  6:06 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2022-07-03  6:06 UTC (permalink / raw
  To: gentoo-commits

commit:     79e5420c22ca6dbb708ef68058c1fff8a8b941f6
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  3 06:03:59 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 06:06:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79e5420c

Revert "media-video/mjpg-streamer: fix init script's non-POSIX features"

This reverts commit 1a15764fea542d473a1abf67ccccd8fd5dee68d5.
A better fix coming right up.

Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-video/mjpg-streamer/files/mjpg-streamer.initd | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.initd b/media-video/mjpg-streamer/files/mjpg-streamer.initd
index 71da09faedf6..e7116dba01d2 100644
--- a/media-video/mjpg-streamer/files/mjpg-streamer.initd
+++ b/media-video/mjpg-streamer/files/mjpg-streamer.initd
@@ -1,9 +1,9 @@
 #!/sbin/openrc-run
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 MJPG_STREAMER_PIDFILE="${MJPG_STREAMER_PIDFILE:-/var/run/${SVCNAME}.pid}"
-MY_NAME="${SVCNAME//-/_}"
+MY_NAME=${SVCNAME//-/_}
 
 depend() {
 	use logger
@@ -13,13 +13,13 @@ depend() {
 checkconfig() {
 	local vars
 
-	[ "${INPUT_PLUGIN}" ] || vars+=\ INPUT_PLUGIN
-	[ "${OUTPUT_PLUGIN}" ] || vars+=\ OUTPUT_PLUGIN
-	[ "${MJPG_STREAMER_USER}" ] || vars+=\ MJPG_STREAMER_USER
-	[ "${MJPG_STREAMER_GROUP}" ] || vars+=\ MJPG_STREAMER_GROUP
+	[[ ${INPUT_PLUGIN} ]] || vars+=\ INPUT_PLUGIN
+	[[ ${OUTPUT_PLUGIN} ]] || vars+=\ OUTPUT_PLUGIN
+	[[ ${MJPG_STREAMER_USER} ]] || vars+=\ MJPG_STREAMER_USER
+	[[ ${MJPG_STREAMER_GROUP} ]] || vars+=\ MJPG_STREAMER_GROUP
 	vars="${vars# }"
 
-	if [ "${vars}" ]; then
+	if [[ ${vars} ]]; then
 		eerror "Required variables in /etc/conf.d/${SVCNAME} are not set:"
 		eerror "  ${vars// /, }"
 		return 1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-03  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-03  6:06 [gentoo-commits] repo/gentoo:master commit in: media-video/mjpg-streamer/files/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2022-07-03  6:06 Joonas Niilola
2022-07-02 17:35 Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox