pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

geomyidae: Rework rc.d a bit



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Fri Aug 10 12:14:37 2018 +0200
Changeset:	b44f74869688aad819a10dfdd8994dead3a0d48e

Modified Files:
	geomyidae/files/geomyidae.sh

Log Message:
geomyidae: Rework rc.d a bit

- Do not define _geomyidae_* variables and directly use @GEOMYIDAE_*@
  instead (NFCI, apart avoiding an extra layer)
- Directly use geomyidae_flags instead of command_args. Unfortunately
  readjusting the options by passing additional geomyidae_flags is not
  supported. So, change the semantic in order to have (hopefully!) good
  default geomyidae_flags but also give the user the power to completely
  readjust them via rc.conf.
- Swap the `${geomyidae_flags} ${command_args}' arguments in the non-rc.subr
  case, for consistency with most rc.d scripts (NFCI)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b44f74869688aad819a10dfdd8994dead3a0d48e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 geomyidae/files/geomyidae.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diffs:
diff --git a/geomyidae/files/geomyidae.sh b/geomyidae/files/geomyidae.sh
index 0b7eb5c2ce..44439beb8b 100755
--- a/geomyidae/files/geomyidae.sh
+++ b/geomyidae/files/geomyidae.sh
@@ -11,17 +11,12 @@ name="geomyidae"
 rcvar=$name
 command="@PREFIX@/sbin/geomyidae"
 
-_geomyidae_user="@GEOMYIDAE_USER@"
-_geomyidae_group="@GEOMYIDAE_GROUP@"
-_geomyidae_rootdir="@GEOMYIDAE_ROOTDIR@"
-
-command_args="-u \"${_geomyidae_user}\" -g \"${_geomyidae_group}\" -b \"${_geomyidae_rootdir}\""
-required_dirs="${_geomyidae_rootdir}"
+geomyidae_flags=${geomyidae_flags-"-u @GEOMYIDAE_USER@ -g @GEOMYIDAE_GROUP@ -b @GEOMYIDAE_ROOTDIR@"}
 
 if [ -f /etc/rc.subr ]; then
 	load_rc_config $name
 	run_rc_command "$1"
 else
 	echo -n "${name}"
-	${command} ${command_args} ${geomyidae_flags} 
+	${command} ${geomyidae_flags} ${command_args} 
 fi


Home | Main Index | Thread Index | Old Index