diff -Nru dphys-config-20100216/Logfile dphys-config-20130301~current/Logfile --- dphys-config-20100216/Logfile 2010-02-16 20:18:46.000000000 +0000 +++ dphys-config-20130301~current/Logfile 2013-03-01 17:09:37.000000000 +0000 @@ -609,6 +609,35 @@ testing "current" 3.5 weeks showed no problems, no new bug reports updated FAQ, INSTALL, index.html.en (incl fixing some awkward HTML syntax) copy to ../dphys-config-20100216, change that Makefile, made tar file of that + remade ../dphys-config.tar.gz archive for current state + +2013.01.10 Thu +Axel Beckert reports Bug in backtick preprocessing, Quoted once too many times + as result spaces and options are considered part of command name, fails +also reports that wget faillure warning keeps triggering hobbit system monitor + would prefer it to just be an informational output +also questions whether it is still maintained, or if he should take it over + is still in productive use by me, so it is still maintained, stays here + +2013.01.11 Fri +Axel Beckert mails all the details and 4 diffs he used to fix it + backtick preprocessing changed from SUBST="`"${TICK}"`" to SUBST="`${TICK}`" + after-wget WARNINGs downgraded to NOTEs, as only transient net failures + and if all 3 rounds fail it is will give an full FATAL error anyway + also information about his interactive testing extension, sounds usefull + mail discussion, what/howmuch of this to use, or what else instead + also information about his hobbit direct calling stuff, rejected + can not be added in my version, as no possibility of me testing it + also discussion of adding testing suite, I have at present no time for such + this would have to be something external, come from him as contribution + possibly as separate programm/script, with its docs, all in subdirectory + also reports potential interest of future rewrite in perl + that would have to be an separate fork/replacement, as 100% new code + +2013.03.01 Fri +slightly improved 2 messages "config" to "list" and "config" to "file" + and also 2 from "config list" to "list" and "config file list" to "file" + the later of these actually is false output, as it is not the list ------ project status diff -Nru dphys-config-20100216/Makefile dphys-config-20130301~current/Makefile --- dphys-config-20100216/Makefile 2010-02-16 20:19:35.000000000 +0000 +++ dphys-config-20130301~current/Makefile 2006-12-22 13:27:31.000000000 +0000 @@ -1,12 +1,12 @@ # http://neil.franklin.ch/Projects/dphys-config/Makefile -# author Neil Franklin, last modification 2010.02.16 +# author Neil Franklin, last modification 2005.12.22 # This Makefile is copyright ETH Zuerich Physics Departement, # use under either modified/non-advertising BSD or GPL license # --- various site dependant user config variables # for creating an [-].tar.gz archive -DIR = dphys-config-20100216 +DIR = dphys-config # --- no user configurable stuff below here diff -Nru dphys-config-20100216/debian/README.source dphys-config-20130301~current/debian/README.source --- dphys-config-20100216/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/README.source 2013-02-11 18:39:18.000000000 +0000 @@ -0,0 +1,8 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +See /usr/share/doc/quilt/README.source for how to apply and unapply +patches manually. + + -- Axel Beckert , Wed, 17 Aug 2011 14:28:03 +0200 diff -Nru dphys-config-20100216/debian/changelog dphys-config-20130301~current/debian/changelog --- dphys-config-20100216/debian/changelog 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/changelog 2013-12-05 00:54:19.000000000 +0000 @@ -1,3 +1,110 @@ +dphys-config (20130301~current-1) unstable; urgency=low + + * New upstream snapshot + + Refresh patches hobbit-support and interactive. + * Upload to unstable again + + [ Elmar S. Heeb ] + * do not start init script on install/upgrade + + [ Axel Beckert ] + * Add patch to be able to escape colons in file names. + * Fix lintian warning init.d-script-does-not-source-init-functions + * Bump Standards-Version to 3.9.4 (no changes) + * Remove reverse-dphys-config again. The interactive patch by Claude + suits the purpose far better, hence reverse-dphys-config is no more + supported. + + Drop build-dependency on help2man and no more suggest SSH clients + * Apply wrap-and-sort + * Set the distribution of some previous changelog entries (20100216-3 to + -6) to "UNRELEASED" to clarify that these releases haven't been + uploaded to Debian. + * Rename debian/dphys-config.lintian-overrides to + debian/lintian-overrides for consistency. + * Bump Standards-Version to 3.9.5 (no changes). + + -- Axel Beckert Thu, 05 Dec 2013 01:53:37 +0100 + +dphys-config (20130111~current-1) experimental; urgency=low + + * New upstream snapshot + + Remove patches downgrade-download-warning.diff and + fix-backtick-quoting.diff, applied upstream. + + Refresh the remaining patches. + * Remove diff+install commandline options due to non-unique letters. + * Clean up debian/rules, use dh style rules. + * Use dh-exec to be able to rename files and hence drop the + override_dh_install and override_dh_installchangelogs targets. + + Add a versioned build-dependency on dh-exec >= 0.6 (due to #698017). + + Add a #!dh-exec shebang line to debian/install, make it executable. + + Bump debhelper compatibility and build-dependency to 9. + * Fix traps in hobbit-support.diff if $HOBBITSERVERS is not defined. + * Switch Vcs-* headers to GitHub. + * Remove superfluous whitespace change in hobbit-support.diff + + -- Axel Beckert Mon, 11 Feb 2013 20:01:01 +0100 + +dphys-config (20100216-6) UNRELEASED; urgency=low + + * fix backtick preprocessing to allow commands with arguments + + -- Elmar S. Heeb Thu, 10 Jan 2013 15:49:52 +0100 + +dphys-config (20100216-5) UNRELEASED; urgency=low + + * added default stop runlevels in init.d + + -- Elmar S. Heeb Thu, 10 Jan 2013 14:28:30 +0100 + +dphys-config (20100216-4) UNRELEASED; urgency=low + + * downgrade download warnings from WARNING to INFO + * added Elmar S. Heeb to uploaders + + -- Elmar S. Heeb Thu, 10 Jan 2013 12:43:55 +0100 + +dphys-config (20100216-3) UNRELEASED; urgency=low + + * Add feature patch for Interactive and Diff mode by Claude Becker. + + Mention Hobbit/Xymon reporting and Interactive mode in the long + description. + * Fix Hobbit/Xymon reporting to not send "green" reports on --help. + * Switch to source format "3.0 (quilt)" + + Remove quilt build-dependency as well as patch and unpatch targets + * Fix lintian warning "init.d-script-does-not-implement-optional-option + status" + * Bump Standards-Version to 3.9.3 (no changes) + + -- Axel Beckert Wed, 15 Aug 2012 20:37:53 +0200 + +dphys-config (20100216-2) UNRELEASED; urgency=low + + * Add new script reverse-dphys-config + + build-depend on help2man for its manpage + + suggest openssh-client | ssh-client + * debian/rules: replace mkdir + cp by install -D + * debian/copyright: + + Remove obsolete copyright of findcdroms.c (no more included upstream + since 20090926) + + Refer to /usr/share/common-licenses/GPL-2 instead of the symbolic + link at /usr/share/common-licenses/GPL + + Update copyright years and my e-mail address + + Reword the section about examples + + Mention reverse-dphys-config + + Update licensing information of the packaging to explicitly mention + version 2 or newer of the GPL. + + Always use dash, does not work with bash anymore. Depend on dash + (for pre-Squeeze systems) + * Bump Standards-Version to 3.9.2 (no changes) + * Fix some lintian warnings: + + debian-rules-missing-recommended-target + + no-upstream-changelog + + missing-debian-source-format (now explicitly "1.0" format) + * Add support for hobbit reporting + + Use quilt patch management + + -- Axel Beckert Tue, 16 Aug 2011 22:50:36 +0200 + dphys-config (20100216-1) unstable; urgency=low * New upstream release diff -Nru dphys-config-20100216/debian/clean dphys-config-20130301~current/debian/clean --- dphys-config-20100216/debian/clean 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/clean 2013-02-11 18:39:18.000000000 +0000 @@ -0,0 +1 @@ +debian/reverse-dphys-config.1 \ No newline at end of file diff -Nru dphys-config-20100216/debian/compat dphys-config-20130301~current/debian/compat --- dphys-config-20100216/debian/compat 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/compat 2013-02-11 18:39:18.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru dphys-config-20100216/debian/control dphys-config-20130301~current/debian/control --- dphys-config-20100216/debian/control 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/control 2013-10-28 12:55:45.000000000 +0000 @@ -2,16 +2,22 @@ Section: admin Priority: optional Maintainer: Axel Beckert -Build-Depends: debhelper (>= 7) -Standards-Version: 3.8.4 +Uploaders: Elmar S. Heeb +Build-Depends: debhelper (>= 9), + dh-exec (>= 0.6) +Standards-Version: 3.9.5 Homepage: http://neil.franklin.ch/Projects/dphys-config/ -Vcs-Browser: http://git.phys.ethz.ch/?p=dphys-config-debian.git -Vcs-Git: http://git.phys.ethz.ch/git/dphys-config-debian.git +Vcs-Browser: https://github.com/isgphys/dphys-config +Vcs-Git: git://github.com/isgphys/dphys-config.git Package: dphys-config Architecture: all -Depends: wget, ${misc:Depends} +Depends: dash, + wget, + ${misc:Depends} Suggests: pciutils +Enhances: hobbit-client, + xymon-client Description: Tool to distribute config files This project is aimed at automatically installing (and keeping update) site specific config files on many hosts, after preprocessing @@ -20,3 +26,9 @@ file has been changed. It can also remove config files, including running an preremove script before doing so. All this is driven by an simple config file list. + . + dphys-config is capable of reporting update failure or success to a + Xymon (formerly Hobbit) monitoring server. + . + dphys-config features an interactive mode and a non-interactive diff + mode to check what would be updated. diff -Nru dphys-config-20100216/debian/copyright dphys-config-20130301~current/debian/copyright --- dphys-config-20100216/debian/copyright 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/copyright 2013-10-01 16:48:38.000000000 +0000 @@ -8,15 +8,6 @@ This software is dual-licensed under the GNU General Public License (GPL), and the modified/non-advertising BSD License (BSD). -License (Public Domain, findcdroms.c): - - Download from http://stian.lunafish.org/coding-cdrom.php - Written by Stian Sebastian Skjelstad - -License (Public Domain, examples written by Gürkan Sengün): - - Download from http://debian.ethz.ch/pub/debian-local/share/kernel/ - License (GPL): Copyright © 2005-2006 Neil Franklin @@ -36,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian GNU/Linux systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. +Public License can be found in `/usr/share/common-licenses/GPL-2'. License (BSD): @@ -66,6 +57,16 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +The examples are under Public Domain, written by Gürkan Sengün and +were downloaded from http://debian.ethz.ch/pub/debian-local/share/kernel/. + +reverse-dphys-config is Copyright © 2011 Axel Beckert +and licensed under the GPL; either version 2 of the License, or (at +your option) any later version. See `/usr/share/common-licenses/GPL-2' +for the complete license text. + The Debian packaging is © 2006, Gürkan Sengün , -© 2009 Axel Beckert and is licensed under the -GPL, see `/usr/share/common-licenses/GPL'. +© 2009-2011 Axel Beckert and is licensed under the +GP; either version 2 of the License, or (at your option) any later +version. See `/usr/share/common-licenses/GPL-2' for the complete +license text. diff -Nru dphys-config-20100216/debian/dphys-config.lintian-overrides dphys-config-20130301~current/debian/dphys-config.lintian-overrides --- dphys-config-20100216/debian/dphys-config.lintian-overrides 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/dphys-config.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# According to the upstream author, "authenti*fi*cation" is commonly -# used English and therefore English, even if it's not in the OED. -dphys-config binary: spelling-error-in-manpage usr/share/man/man1/dphys-config.1.gz authentification authentication diff -Nru dphys-config-20100216/debian/examples dphys-config-20130301~current/debian/examples --- dphys-config-20100216/debian/examples 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/examples 2013-02-11 18:39:18.000000000 +0000 @@ -0,0 +1 @@ +dphys-config.example diff -Nru dphys-config-20100216/debian/init.d dphys-config-20130301~current/debian/init.d --- dphys-config-20100216/debian/init.d 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/init.d 2013-10-01 16:17:20.000000000 +0000 @@ -18,13 +18,15 @@ # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 -# Default-Stop: +# Default-Stop: 0 1 6 # Short-Description: Fetch and merge config files, run scripts when they change # Description: Tool to get a list of config files, and for each file # in that list retrieve it from same server and install # it if not yet there. ### END INIT INFO +. /lib/lsb/init-functions + PATH=/sbin:/bin:/usr/sbin:/usr/bin export PATH @@ -103,8 +105,8 @@ /bin/echo "'Stopping' ${NAME} automatic config updates (does nothing)." ;; - restart|reload|force-reload) - /bin/echo "No daemon to (force-)re[start|load] in ${NAME}" + restart|reload|force-reload|status) + /bin/echo "No daemon to (force-)re[start|load] or check in ${NAME}" ;; *) diff -Nru dphys-config-20100216/debian/install dphys-config-20130301~current/debian/install --- dphys-config-20100216/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/install 2013-10-01 16:46:10.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/dh-exec +dphys-config.example => etc/dphys-config +Logfile => usr/share/doc/dphys-config/changelog diff -Nru dphys-config-20100216/debian/lintian-overrides dphys-config-20130301~current/debian/lintian-overrides --- dphys-config-20100216/debian/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/lintian-overrides 2013-02-11 18:39:18.000000000 +0000 @@ -0,0 +1,3 @@ +# According to the upstream author, "authenti*fi*cation" is commonly +# used English and therefore English, even if it's not in the OED. +dphys-config binary: spelling-error-in-manpage usr/share/man/man1/dphys-config.1.gz authentification authentication diff -Nru dphys-config-20100216/debian/patches/escaping-colons.diff dphys-config-20130301~current/debian/patches/escaping-colons.diff --- dphys-config-20100216/debian/patches/escaping-colons.diff 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/patches/escaping-colons.diff 2013-10-01 16:21:22.000000000 +0000 @@ -0,0 +1,59 @@ +Description: Support file names that contain colon, backslash or \n +Author: Axel Beckert + +Index: dphys-config/dphys-config +=================================================================== +--- dphys-config.orig/dphys-config 2013-09-06 17:01:19.000000000 +0200 ++++ dphys-config/dphys-config 2013-09-06 17:05:25.000000000 +0200 +@@ -90,24 +90,27 @@ + LANG=C + export LANG + ++# Overwrite the builtin echo with the one from GNU coreutils as the ++# builtin one parses escape sequences unconditionally. Meh. ++alias echo=/bin/echo + + # --- tidy up some commands, make systematic + + # stuff that goes wrong, not expected by user, not in data output, use >&2 + # so also with $0 in case this script was called by an other script + # something within the system that user does not expect, give up +-CMD_FATAL="echo $0: FATAL:" ++CMD_FATAL="/bin/echo $0: FATAL:" + # something from users input, user will correct this and continue +-CMD_ERROR="echo $0: ERROR:" ++CMD_ERROR="/bin/echo $0: ERROR:" + # something we can continue with, but may be wrong, and user may not suspect it +-CMD_WARNING="echo $0: WARNING:" ++CMD_WARNING="/bin/echo $0: WARNING:" + # something most likely not wrong, but tell user for the odd case it is wrong +-CMD_NOTE="echo $0: NOTE:" ++CMD_NOTE="/bin/echo $0: NOTE:" + + # normal stuff users expect, so to stdout as normal output, no $0, no marking +-CMD_INFO="echo" ++CMD_INFO="/bin/echo" + # stuff users asked for, so add to stdout as normal output, no $0, but mark it +-CMD_DEBUG="echo DEBUG:" ++CMD_DEBUG="/bin/echo DEBUG:" + + + # and also put out some permanent messages, in case running as cron/init.d job +@@ -947,7 +950,7 @@ + fi + + # place-on-target: put result here +- CONFFILE_PLACE="`echo "${LINE}" | cut -f 2 -d ':'`" ++ CONFFILE_PLACE="`echo "${LINE}" | sed 's/\\\\:/\x00/g;s/[\\]n/\\x6e/g' | cut -f 2 -d ':' | sed -e 's/\x00/:/g'`" + # needs to be set, but may be unset if mothing between the first 2 : + if [ "`echo "${CONFFILE_PLACE}" | tr -d ' '`" = "" ] ; then + ${CMD_ERROR} "config line \"${LINE}\" has no config place" \ +@@ -961,7 +964,7 @@ + # run post installing (or pre removing) an config file + # if no second : on line or nothing after it this is automatically blank + # if more than 2 : on line include the rest of them into this with 3- +- CMDTRIG="`echo "${LINE}" | cut -f 3- -d ':'`" ++ CMDTRIG="`echo "${LINE}" | sed 's/\\\\:/\x00/g;s/[\\]n/\\x6e/g' | cut -f 3- -d ':' | sed -e 's/\x00/:/g'`" + + ${CMD_DEBUG_PRINT} "CONFFILE_NAME=${CONFFILE_NAME}" \ + "CONFFILE_PLACE=${CONFFILE_PLACE} CMDTRIG=${CMDTRIG}" diff -Nru dphys-config-20100216/debian/patches/hobbit-support.diff dphys-config-20130301~current/debian/patches/hobbit-support.diff --- dphys-config-20100216/debian/patches/hobbit-support.diff 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/patches/hobbit-support.diff 2013-10-01 16:31:52.000000000 +0000 @@ -0,0 +1,118 @@ +Enables dphys-config to report to hobbit servers + +Index: dphys-config/dphys-config +=================================================================== +--- dphys-config.orig/dphys-config 2013-10-01 18:31:05.000000000 +0200 ++++ dphys-config/dphys-config 2013-10-01 18:31:05.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/dash + # /usr/bin/dphys-config - install/update config files and trigger commands + # author Neil Franklin, last modification 2013.03.01 + # copyright ETH Zuerich Physics Departement, +@@ -287,6 +287,87 @@ + ${CMD_DEBUG_WAIT} + + ++# Setup hobbit/xymon support ++if [ -e /etc/default/hobbit-client ] ; then ++ . /etc/default/hobbit-client ++fi ++if [ -n "${HOBBITSERVERS}" -a '(' -x '/usr/lib/hobbit/client/bin/bb' -o -x '/usr/lib/xymon/client/bin/xymon' ')' ] ; then ++ HOBBITCOLOR=green ++ HOBBITMESSAGE="" ++ if [ -x '/usr/lib/hobbit/client/bin/bb' ]; then ++ HOBBITBBCMD=/usr/lib/hobbit/client/bin/bb ++ elif [ -x '/usr/lib/xymon/client/bin/xymon' ]; then ++ HOBBITBBCMD=/usr/lib/xymon/client/bin/xymon ++ fi ++ ++ color_line() { ++ LOCALCOLOR="$1" ++ shift ++ SYSLOGLEVEL="$1" ++ shift ++ HOBBITMESSAGE="${HOBBITMESSAGE}&${LOCALCOLOR} $* ++" ++ if [ "${HOBBITCOLOR}" = 'green' ]; then ++ ${CMD_DEBUG_PRINT} "Setting color to ${LOCALCOLOR}" ++ HOBBITCOLOR="${LOCALCOLOR}" ++ elif [ "${HOBBITCOLOR}" = 'yellow' -a "${LOCALCOLOR}" = 'red' ]; then ++ ${CMD_DEBUG_PRINT} "Setting color to ${LOCALCOLOR}" ++ HOBBITCOLOR="${LOCALCOLOR}" ++ fi ++ ${CMD_DEBUG_PRINT} "color_line: HOBBITCOLOR is ${HOBBITCOLOR}" ++ logger -t "${BASENAME}" -p user."${SYSLOGLEVEL}" "$*" ++ } ++ ++ hobbit_line() { ++ HOBBITMESSAGE="${HOBBITMESSAGE}$* ++" ++ ${CMD_DEBUG_PRINT} "hobbit_line: HOBBITCOLOR is ${HOBBITCOLOR}" ++ logger -t "${BASENAME}" -p user.info "$*" ++ } ++ ++ hobbit_printonly_line() { ++ HOBBITMESSAGE="${HOBBITMESSAGE}$* ++" ++ ${CMD_DEBUG_PRINT} "hobbit_printonly_line: HOBBITCOLOR is ${HOBBITCOLOR}" ++ "${CMD_INFO}" "$*" ++ } ++ ++ hobbit_send() { ++ ${CMD_DEBUG_PRINT} "Sending the following status report (${HOBBITCOLOR}) to ${HOBBITSERVERS}:" ++ ${CMD_DEBUG_SLEEP} ++ if [ "${HOBBITCOLOR}" = 'green' ]; then ++ HOBBITOK="OK" ++ else ++ HOBBITOK="NOT OK" ++ fi ++ DATE=`date` ++ HOBBITSTATUS="status+${HOBBITVALIDITY:-2160} ${CLIENTHOSTNAME:-${CONF_CONFNAME}}.${HOBBIT_TESTNAME:-dpc} ${HOBBITCOLOR} ${DATE} dphys-config ${HOBBITOK} ++ ++${HOBBITMESSAGE}" ++ ${CMD_DEBUG_PRINT} "${HOBBITSTATUS}" ++ for hobbitserver in ${HOBBITSERVERS}; do ++ ${HOBBITBBCMD} $hobbitserver "${HOBBITSTATUS}" ++ done ++ } ++ ++ # something within the system that user does not expect, give up ++ CMD_LOG_FATAL="color_line red error $0: FATAL:" ++ # something from users input, user will correct this and continue ++ CMD_LOG_ERROR="color_line red error $0: ERROR:" ++ # something we can continue with, but may be wrong, and user may not suspect it ++ CMD_LOG_WARNING="color_line yellow warning $0: WARNING:" ++ # something most likely not wrong, but tell user for the odd case it is wrong ++ CMD_LOG_NOTE="color_line green notice $0: NOTE:" ++ # normal stuff users expect, so no marking ++ CMD_LOG_INFO="hobbit_line" ++ CMD_INFO_PRINT="hobbit_printonly_line" ++ ++ # Send hobbit report on exit or error ++ trap hobbit_send 0 ++else ++ hobbit_send() (:) ++fi ++ + # --- spread config file server load + + # avoid load peak on the file server from over 100 machines at same time +@@ -719,6 +800,8 @@ + ${CMD_INFO_PRINT} "processing individual config files from the list ..." + ${CMD_DEBUG_SLEEP} + ++trap - 0 ++ + # cut get rid of comments and grep empty lines (may be emptied comment lines) + # and allow user to select/filter subset of lines to be processed + # IFS= to avoid read doing separator processing (mangles spaces) +@@ -726,6 +809,8 @@ + cut -f 1 -d '#' "${CONFLIST_PLACE}" | grep -v '^ *$' | \ + grep "${CONF_LINEFILTER}" | while IFS= read -r LINE ; do + ++ trap hobbit_send 0 ++ + ${CMD_DEBUG_PRINT} "LINE=${LINE}" + ${CMD_DEBUG_WAIT} + diff -Nru dphys-config-20100216/debian/patches/interactive.diff dphys-config-20130301~current/debian/patches/interactive.diff --- dphys-config-20100216/debian/patches/interactive.diff 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/patches/interactive.diff 2013-10-01 16:34:27.000000000 +0000 @@ -0,0 +1,327 @@ +Author: Claude Becker +Author: Axel Beckert +Description: Adds options -i and -d for interctive and diff mode. + +Index: dphys-config/dphys-config +=================================================================== +--- dphys-config.orig/dphys-config 2013-02-11 19:46:13.000000000 +0100 ++++ dphys-config/dphys-config 2013-02-11 19:46:13.000000000 +0100 +@@ -136,6 +136,18 @@ + CMD_INFO_PRINT="${CMD_INFO}" + CMD_VERBOSE_PRINT=true + ++# command to use for viewing diffs in interactive mode ++if [ -x /usr/bin/colordiff ] ; then ++ CMD_DIFF='colordiff -w -u' ++else ++ CMD_DIFF='diff -w -u' ++fi ++ ++if [ -x /usr/bin/dwdiff ] ; then ++ CMD_WDIFF='dwdiff -c' ++else ++ CMD_WDIFF='wdiff' ++fi + + # set debug option controllable stuff + if [ "${DEBUG_SLEEP}" = yes ] ; then +@@ -211,6 +223,22 @@ + shift 1 + ;; + ++ i) ++ # interactive mode: prompt for action before updating file ++ INTERACTIVE_MODE=true ++ ;; ++ ++ d) ++ # diff-only mode: show diff of changed files before installing them ++ DIFF_ONLY_MODE=true ++ ;; ++ ++ w) ++ # diff+install mode: show diff of changed files before installing them ++ DIFF_ONLY_MODE=true ++ WDIFF_MODE=true ++ ;; ++ + q) + # quiet: don't inform user what we are doing + CMD_INFO_PRINT=true +@@ -244,6 +283,9 @@ + options: + -c configname: use this set of config files instead of hostname set + -f filter filter: only process lines matching this grep regexp ++ -i interactive mode: prompt for action before updating file ++ -d diff-only mode: show diff of changed file but don't install them ++ -w wdiff-only mode: show word-diff of changed file but don't install them + -q quiet: don't give user an running report of what we are doing + -v verbose: give user detailed running report + -D Debug: activate an debug option, see source for operation +@@ -738,6 +782,90 @@ + + } + ++# --- install new config file ++ ++install_config_file () { ++ ${CMD_INFO_PRINT} "updating old or installing new config" \ ++ "${CONFFILE_NAME} as ${CONFFILE_PLACE} ..." ++ ${CMD_DEBUG_SLEEP} ++ ++ cp -pf "${CONFFILE}" "${CONFFILE_PLACE}" ++ ++ ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" ++ ${CMD_DEBUG_WAIT} ++ ++ ++ # run the facultative postinstall command trigger stuff ++ if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then ++ ++ ${CMD_INFO_PRINT} "triggering postinstall command \"${CMDTRIG}\" ..." ++ ${CMD_DEBUG_SLEEP} ++ ++ # prevent non zero return from user given command from killing us ++ set +e ++ sh -c "${CMDTRIG}" ++ RETVAL="$?" ++ set -e ++ if [ "${RETVAL}" != 0 ] ; then ++ ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 ++ ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" ++ fi ++ ++ ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" ++ ${CMD_DEBUG_WAIT} ++ ++ fi ++ ++ return 0 ++} ++ ++# --- remove existing config file ++ ++remove_config_file () { ++ ${CMD_INFO_PRINT} "removing old config file ${CONFFILE_PLACE} ..." ++ ${CMD_DEBUG_SLEEP} ++ ++ # test for only directory name (ends in /), possibly dangerous leftover ++ if [ "`echo "${CONFFILE_PLACE}" | rev | cut -c 1`" = "/" ] ; then ++ ++ ${CMD_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ ++ "may be partially edited list file entry, DANGEROUS, leaving it," \ ++ "add the files name after the / to delete an single file," \ ++ "remove / after dir name to really delete entire directory" >&2 ++ ${CMD_LOG_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ ++ "may be partially edited list file entry, DANGEROUS, leaving it," \ ++ "add the files name after the / to delete an single file," \ ++ "remove / after dir name to really delete entire directory" ++ ++ else ++ ++ # run the facultative preremove command trigger stuff ++ if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then ++ ++ ${CMD_INFO_PRINT} "triggering preremove command \"${CMDTRIG}\" ..." ++ ${CMD_DEBUG_SLEEP} ++ ++ set +e ++ sh -c "${CMDTRIG}" ++ RETVAL="$?" ++ set -e ++ if [ "${RETVAL}" != 0 ] ; then ++ ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 ++ ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" ++ fi ++ ++ fi ++ ++ ${CMD_INFO_PRINT} "removing config file ${CONFFILE_PLACE} ..." ++ ${CMD_DEBUG_SLEEP} ++ ++ ${CMD_DEBUG_PRINT} "`ls -ald "${CONFFILE_PLACE}"`" ++ ${CMD_DEBUG_WAIT} ++ ++ rm -rf "${CONFFILE_PLACE}" ++ ++ fi ++} + + # --- download config file list + +@@ -922,36 +1050,68 @@ + # only if file has changed do we do anything, as for config list + if ! diff "${CONFFILE_PLACE}" "${CONFFILE}" > /dev/null ; then + +- ${CMD_INFO_PRINT} "updating old or installing new file" \ +- "${CONFFILE_NAME} as ${CONFFILE_PLACE} ..." +- ${CMD_DEBUG_SLEEP} +- +- cp -pf "${CONFFILE}" "${CONFFILE_PLACE}" +- +- ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" +- ${CMD_DEBUG_WAIT} +- +- +- # run the facultative postinstall command trigger stuff +- if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then +- +- ${CMD_INFO_PRINT} "triggering postinstall command \"${CMDTRIG}\" ..." +- ${CMD_DEBUG_SLEEP} +- +- # prevent non zero return from user given command from killing us +- set +e +- sh -c "${CMDTRIG}" +- RETVAL="$?" +- set -e +- if [ "${RETVAL}" != 0 ] ; then +- ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 +- ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" +- fi ++ ACTION_EXECUTED=false + +- ${CMD_DEBUG_PRINT} "`ls -al "${CONFFILE_PLACE}"`" +- ${CMD_DEBUG_WAIT} ++ while [ $ACTION_EXECUTED != true ] ; do ++ if [ $INTERACTIVE_MODE ] ; then ++ # prompt user for action ++ echo "" ++ printf "Found new version for ${CONFFILE_PLACE}\n" ++ printf "[i]nstall [d]iff [D]iff+install [w]diff [W]diff+install [s]kip " ++ ACTION=$(bash --noprofile --norc -c 'read -n 1 ACTION < /dev/tty; echo $ACTION') ++ echo "" ++ elif [ $DIFF_ONLY_MODE ] ; then ++ # default action is to diff-only ++ if [ $WDIFF_MODE ]; then ++ ACTION='w' ++ else ++ ACTION='d' ++ fi ++ else ++ # default action is to install ++ ACTION='i' ++ fi + +- fi ++ case $ACTION in ++ s|n) # skip file ++ ACTION_EXECUTED=true ++ echo "Skipping this file and keeping currently installed version." ++ ;; ++ i|y) # install file ++ ACTION_EXECUTED=true ++ install_config_file ++ ;; ++ d) # diff file ++ if [ $DIFF_ONLY_MODE ]; then ++ ACTION_EXECUTED=true ++ fi ++ ${CMD_DIFF} ${CONFFILE_PLACE} ${CONFFILE} || true ++ ;; ++ D) # diff + install file ++ ACTION_EXECUTED=true ++ ${CMD_DIFF} ${CONFFILE_PLACE} ${CONFFILE} || true ++ install_config_file ++ ;; ++ w) # wdiff file ++ if [ $DIFF_ONLY_MODE ]; then ++ ACTION_EXECUTED=true ++ fi ++ ${CMD_WDIFF} ${CONFFILE_PLACE} ${CONFFILE} || true ++ ;; ++ W) # wdiff + install file ++ ACTION_EXECUTED=true ++ ${CMD_WDIFF} ${CONFFILE_PLACE} ${CONFFILE} || true ++ install_config_file ++ ;; ++ q) # quit ++ echo "Skipping this and all other pending files." ++ exit 42 ++ ;; ++ *) ++ echo "Unknown action '$ACTION'." ++ ;; ++ esac ++ done + + fi + +@@ -962,49 +1129,39 @@ + # only if file still exists do we do anything + if [ -e "${CONFFILE_PLACE}" ] ; then + +- ${CMD_INFO_PRINT} "removing old config file ${CONFFILE_PLACE} ..." +- ${CMD_DEBUG_SLEEP} +- +- # test for only directory name (ends in /), possibly dangerous leftover +- if [ "`echo "${CONFFILE_PLACE}" | rev | cut -c 1`" = "/" ] ; then +- +- ${CMD_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ +- "may be partially edited list file entry, DANGEROUS, leaving it," \ +- "add the files name after the / to delete an single file," \ +- "remove / after dir name to really delete entire directory" >&2 +- ${CMD_LOG_WARNING} "would remove entire directory ${CONFFILE_PLACE}," \ +- "may be partially edited list file entry, DANGEROUS, leaving it," \ +- "add the files name after the / to delete an single file," \ +- "remove / after dir name to really delete entire directory" ++ ACTION_EXECUTED=false + +- else +- +- # run the facultative preremove command trigger stuff +- if [ "`echo "${CMDTRIG}" | tr -d ' '`" != "" ] ; then +- +- ${CMD_INFO_PRINT} "triggering preremove command \"${CMDTRIG}\" ..." +- ${CMD_DEBUG_SLEEP} +- +- set +e +- sh -c "${CMDTRIG}" +- RETVAL="$?" +- set -e +- if [ "${RETVAL}" != 0 ] ; then +- ${CMD_WARNING} "command returned non zero: ${RETVAL}" >&2 +- ${CMD_LOG_WARNING} "command returned non zero: ${RETVAL}" ++ while [ $ACTION_EXECUTED != true ] ; do ++ if [ $INTERACTIVE_MODE ] ; then ++ # prompt user for action ++ echo "" ++ printf "Found config file ${CONFFILE_PLACE} to be deleted\n" ++ printf "[r]emove [v]iew [s]kip " ++ ACTION=$(bash --noprofile --norc -c 'read -n 1 ACTION < /dev/tty; echo $ACTION') ++ echo "" ++ else ++ # default action is to remove ++ ACTION='r' + fi + +- fi ++ case $ACTION in ++ s|n) # skip file ++ ACTION_EXECUTED=true ++ echo "Skipping this file and keeping currently installed version." ++ ;; ++ r|y) # remove file ++ ACTION_EXECUTED=true ++ remove_config_file ++ ;; ++ v) # view file ++ ${CMD_DIFF} ${CONFFILE_PLACE} /dev/null || true ++ ;; ++ *) ++ echo "Unknown action '$ACTION'." ++ ;; ++ esac ++ done + +- ${CMD_INFO_PRINT} "removing config file ${CONFFILE_PLACE} ..." +- ${CMD_DEBUG_SLEEP} +- +- ${CMD_DEBUG_PRINT} "`ls -ald "${CONFFILE_PLACE}"`" +- ${CMD_DEBUG_WAIT} +- +- rm -rf "${CONFFILE_PLACE}" +- +- fi + + fi + diff -Nru dphys-config-20100216/debian/patches/series dphys-config-20130301~current/debian/patches/series --- dphys-config-20100216/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/patches/series 2013-09-06 11:31:19.000000000 +0000 @@ -0,0 +1,3 @@ +hobbit-support.diff +interactive.diff +escaping-colons.diff diff -Nru dphys-config-20100216/debian/rules dphys-config-20130301~current/debian/rules --- dphys-config-20100216/debian/rules 2013-12-05 11:49:15.000000000 +0000 +++ dphys-config-20130301~current/debian/rules 2013-10-01 16:43:52.000000000 +0000 @@ -2,51 +2,8 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -DESTDIR=$(CURDIR)/debian/dphys-config +%: + dh $@ -build: build-stamp - -build-stamp: - dh_testdir - $(MAKE) - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - $(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - $(MAKE) install DESTDIR=$(DESTDIR) - # Install example config file as default config file - mkdir -pv $(CURDIR)/debian/dphys-config/etc/ - cp -av dphys-config.example $(DESTDIR)/etc/dphys-config - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installinit -- defaults 21 - dh_installcron - dh_lintian - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-dependent files here. -binary-arch: build install -# We have nothing to do by default. - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +override_dh_installinit: + dh_installinit --no-start diff -Nru dphys-config-20100216/debian/source/format dphys-config-20130301~current/debian/source/format --- dphys-config-20100216/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ dphys-config-20130301~current/debian/source/format 2013-12-05 11:49:15.490401387 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru dphys-config-20100216/dphys-config dphys-config-20130301~current/dphys-config --- dphys-config-20100216/dphys-config 2010-01-21 16:47:36.000000000 +0000 +++ dphys-config-20130301~current/dphys-config 2013-03-01 17:06:13.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # /usr/bin/dphys-config - install/update config files and trigger commands -# author Neil Franklin, last modification 2010.01.21 +# author Neil Franklin, last modification 2013.03.01 # copyright ETH Zuerich Physics Departement, # use under either modified/non-advertising BSD or GPL license @@ -380,15 +380,19 @@ # 2 similar "elif" as some shells built-in [ command fail on -o operator if [ "${DNS_STAT}" != "" ] ; then - ${CMD_WARNING} "failed try ${TRY} to resolve server for URL ${URL}" >&2 - ${CMD_LOG_WARNING} "failed try ${TRY} to resolve server for URL ${URL}" + # having these as WARNING triggers one users hobbit system monitor + # is unnecessary for what are just transient network errors, use NOTE + # especially as all 3 attemps failing will fall into below FATAL + ${CMD_NOTE} "failed try ${TRY} to resolve server for URL ${URL}" >&2 + ${CMD_LOG_NOTE} "failed try ${TRY} to resolve server for URL ${URL}" elif ( [ "${HTTP_STAT}" = 200 ] || [ "${HTTP_STAT}" = 404 ] ) ; then # we managed to get a file, or there is no file, both are OK for us return 0 else - ${CMD_WARNING} "failed try ${TRY} to retrieve file from" \ + # same downgrade from WARNING to NOTE as above + ${CMD_NOTE} "failed try ${TRY} to retrieve file from" \ "URL ${URL}, with HTTP status ${HTTP_STAT}" >&2 - ${CMD_LOG_WARNING} "failed try ${TRY} to retrieve file from" \ + ${CMD_LOG_NOTE} "failed try ${TRY} to retrieve file from" \ "URL ${URL}, with HTTP status ${HTTP_STAT}" fi @@ -546,7 +550,7 @@ # prevent non zero return from user given command from killing us set +e local SUBST - SUBST="`"${TICK}"`" + SUBST="`${TICK}`" RETVAL="$?" set -e if [ "${RETVAL}" != 0 ] ; then @@ -679,11 +683,11 @@ fi -# if file nonexistant generate, empty, hopefully that will not break something -# need to prevent diff below from complaining about missing previous file +# need to prevent diff below from complaining about missing previous file +# if file nonexistant generate, empty, hopefully this will not break anything if [ ! -e "${CONFLIST_PLACE}" ] ; then - ${CMD_INFO_PRINT} "will be installing new config list at ${CONFLIST_PLACE}" + ${CMD_INFO_PRINT} "will be installing new list at ${CONFLIST_PLACE}" ${CMD_DEBUG_SLEEP} # empty file ensures it is different (new one from server is not empty) @@ -698,7 +702,7 @@ # so ! in here despite wanting to do the if stuff in case of difference if ! diff "${CONFLIST_PLACE}" "${CONFLIST}" > /dev/null ; then - ${CMD_INFO_PRINT} "updating old or installing new config" \ + ${CMD_INFO_PRINT} "updating old or installing new list" \ "${SYS_CONFLIST_NAME} as ${CONFLIST_PLACE} ..." ${CMD_DEBUG_SLEEP} @@ -820,7 +824,7 @@ # prevent diff complaining fix, as for config list if [ ! -e "${CONFFILE_PLACE}" ] ; then - ${CMD_INFO_PRINT} "will be installing new config file list at" \ + ${CMD_INFO_PRINT} "will be installing new file at" \ "${CONFFILE_PLACE}" ${CMD_DEBUG_SLEEP} @@ -833,7 +837,7 @@ # only if file has changed do we do anything, as for config list if ! diff "${CONFFILE_PLACE}" "${CONFFILE}" > /dev/null ; then - ${CMD_INFO_PRINT} "updating old or installing new config" \ + ${CMD_INFO_PRINT} "updating old or installing new file" \ "${CONFFILE_NAME} as ${CONFFILE_PLACE} ..." ${CMD_DEBUG_SLEEP}