packages: tzdata/timezone.init - more verbose and accurate messages

gotar gotar at pld-linux.org
Fri Oct 29 02:26:50 CEST 2010


Author: gotar                        Date: Fri Oct 29 00:26:50 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- more verbose and accurate messages

---- Files affected:
packages/tzdata:
   timezone.init (1.16 -> 1.17) 

---- Diffs:

================================================================
Index: packages/tzdata/timezone.init
diff -u packages/tzdata/timezone.init:1.16 packages/tzdata/timezone.init:1.17
--- packages/tzdata/timezone.init:1.16	Thu Jul  8 12:49:17 2010
+++ packages/tzdata/timezone.init	Fri Oct 29 02:26:45 2010
@@ -26,6 +26,7 @@
 
 start() {
 	if [ -f /var/lock/subsys/timezone ]; then
+		msg_already_running timezone
 		return
 	fi
 
@@ -34,9 +35,12 @@
 
 		MESSAGE=$(nls 'Setting time zone information (%s)' "$TIMEZONE")
 
-		run_cmd "$MESSAGE" cp -af $ZONE_FILE /etc/localtime
+		run_cmd "$MESSAGE" cp -af "$ZONE_FILE" /etc/localtime
 		RETVAL=$?
 		restorecon /etc/localtime >/dev/null 2>&1
+	else
+		show "Missing %s file" "$ZONE_FILE"
+		fail
 	fi
 
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/timezone
@@ -57,7 +61,7 @@
 	start
 	;;
   stop)
-  	stop
+	stop
 	;;
   restart|try-restart|reload|force-reload)
 	stop
@@ -67,7 +71,12 @@
 	disable
 	;;
   status)
-	nls 'Time zone configured to (%s)' "$TIMEZONE"
+  	if [ -x /usr/bin/diff ]; then
+  		diff -q "$ZONE_FILE" /etc/localtime >/dev/null 2>&1 && \
+		nls 'Time zone is configured to %s' "$TIMEZONE" || \
+		nls 'Current time zone differs from %s!' "$TIMEZONE"
+	else	nls 'Time zone should be set to %s' "$TIMEZONE"
+	fi
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|disable|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/tzdata/timezone.init?r1=1.16&r2=1.17&f=u



More information about the pld-cvs-commit mailing list