Package: coquelicot
Version: 0.9.3-1
Tags: patch
Control: block -1 by 774944

This is another patchset following from patches I provided for #774859 and then
#774944. The first patch adds a defaults file with "VERBOSE='yes'", handling in
the init script for defaults overrides, and extra typical initscript
sanity-checking and instructional comments. The second patch is purely
whitespace cleanup and is obviously not important.

-- 
Rowan Thorpe
PGP fingerprint:
 BB0A 0787 C0EE BDD8 7F97  3D30 49F2 13A5 265D CCBD
----
"There is a great difference between worry and concern. A worried person sees
a problem, and a concerned person solves a problem."
 - Harold Stephens
>From 7f19d5b36067459b3682119e6392e88dfca9e060 Mon Sep 17 00:00:00 2001
From: Rowan Thorpe <ro...@rowanthorpe.com>
Date: Thu, 19 Feb 2015 11:59:02 +0200
Subject: [PATCH 1/2] Another fix related to new upstream 0.9.3

* Add defaults file with $VERBOSE setting
* Additions to init script
  - exit if binary uninstalled
  - source defaults file
  - add standard init instructional comments
  - add true statements ":" to stop $VERBOSE tests causing exit non-zero
---
 debian/coquelicot.default |  9 +++++++++
 debian/coquelicot.init.d  | 14 ++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 debian/coquelicot.default

diff --git a/debian/coquelicot.default b/debian/coquelicot.default
new file mode 100644
index 0000000..7e69c34
--- /dev/null
+++ b/debian/coquelicot.default
@@ -0,0 +1,9 @@
+# Defaults for coquelicot initscript
+# sourced by /etc/init.d/coquelicot
+# installed at /etc/default/coquelicot by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+VERBOSE='yes'
diff --git a/debian/coquelicot.init.d b/debian/coquelicot.init.d
index 478ced0..6117681 100755
--- a/debian/coquelicot.init.d
+++ b/debian/coquelicot.init.d
@@ -12,6 +12,7 @@
 
 # Do NOT "set -e"
 
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC='Coquelicot "one-click" file sharing web application'
 NAME=coquelicot
@@ -19,7 +20,17 @@ DAEMON=/usr/bin/coquelicot
 DAEMON_ARGS="start"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
+# override the below settings in /etc/default/coquelicot
+VERBOSE='yes'
 
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+! [ -r /etc/default/$NAME ] || . /etc/default/$NAME
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
 
 do_start()
@@ -55,6 +66,7 @@ case "$1" in
 	    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 	    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 	esac
+	:
 	;;
     stop)
 	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
@@ -63,6 +75,7 @@ case "$1" in
 	    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 	    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 	esac
+	:
 	;;
     status)
 	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
@@ -92,6 +105,7 @@ case "$1" in
 	    0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 	    *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 	esac
+	:
 	;;
   *)
 	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|reopen-logs}" >&2
-- 
2.1.4

>From 1bf0c4e67c95bc5f8d8647e8171b00e4e3f00ba6 Mon Sep 17 00:00:00 2001
From: Rowan Thorpe <ro...@rowanthorpe.com>
Date: Thu, 19 Feb 2015 12:01:34 +0200
Subject: [PATCH 2/2] Another fix related to new upstream 0.9.3

* Tab-alignment cleanup in init script (only whitespace changes)
---
 debian/coquelicot.init.d | 94 ++++++++++++++++++++++++------------------------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/debian/coquelicot.init.d b/debian/coquelicot.init.d
index 6117681..b4adcc7 100755
--- a/debian/coquelicot.init.d
+++ b/debian/coquelicot.init.d
@@ -59,56 +59,56 @@ do_reopen_logs()
 }
 
 case "$1" in
-    start)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-	do_start
-	case "$?" in
-	    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-	    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-	esac
-	:
-	;;
-    stop)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-	do_stop
-	case "$?" in
-	    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-	    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-	esac
-	:
-	;;
-    status)
-	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
-	;;
-    restart|force-reload)
-	log_daemon_msg "Restarting $DESC" "$NAME"
-	do_stop
-	case "$?" in
-	  0|1)
+	start)
+		[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 		do_start
 		case "$?" in
-			0) log_end_msg 0 ;;
-			1) log_end_msg 1 ;; # Old process is still running
-			*) log_end_msg 1 ;; # Failed to start
+			0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 		esac
+		:
 		;;
-	  *)
-		# Failed to stop
-		log_end_msg 1
+	stop)
+		[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+		do_stop
+		case "$?" in
+			0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		esac
+		:
+		;;
+	status)
+		status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+		;;
+	restart|force-reload)
+		log_daemon_msg "Restarting $DESC" "$NAME"
+		do_stop
+		case "$?" in
+			0|1)
+				do_start
+				case "$?" in
+					0) log_end_msg 0 ;;
+					1) log_end_msg 1 ;; # Old process is still running
+					*) log_end_msg 1 ;; # Failed to start
+				esac
+				;;
+			*)
+				# Failed to stop
+				log_end_msg 1
+				;;
+		esac
+		;;
+	reopen-logs)
+		[ "$VERBOSE" != no ] && log_daemon_msg "Reopening log files of $DESC" "$NAME"
+		do_reopen_logs
+		case "$?" in
+			0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			*) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		esac
+		:
+		;;
+	*)
+		echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|reopen-logs}" >&2
+		exit 3
 		;;
-	esac
-	;;
-    reopen-logs)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Reopening log files of $DESC" "$NAME"
-	do_reopen_logs
-	case "$?" in
-	    0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-	    *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-	esac
-	:
-	;;
-  *)
-	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|reopen-logs}" >&2
-	exit 3
-	;;
 esac
-- 
2.1.4

Reply via email to