Control tags -1 - moreinfo Control retitle -1 unblock: nut/2.6.4-2.2 On Sat, Dec 22, 2012 at 05:34:13PM +0100, gregor herrmann wrote: > On Thu, 20 Dec 2012 20:47:13 +0100, Ivo De Decker wrote: > > > > Looks good but (there is always a but :), > > Thanks for the review. > > I added it to nut-client as well (new debdiffs attached). > > Thanks, uploaded with this debdiff (to DELAYED/1 in case the > maintainer or the RT want to take a last look).
The upload of nut 2.6.4-2.2 just entered unstable. Thanks gregor! The debdiff is attached. Cheers, Ivo
diff -Nru nut-2.6.4/debian/changelog nut-2.6.4/debian/changelog --- nut-2.6.4/debian/changelog 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/changelog 2012-12-20 20:40:14.000000000 +0100 @@ -1,3 +1,52 @@ +nut (2.6.4-2.2) unstable; urgency=low + + * Non-maintainer upload with fixes for wheezy. + * Only remove /etc/init.d/nut from previous versions of nut in nut-server + postinst if there are no local changes. + * Also remove /etc/init.d/nut in nut-client postinst. Thanks to + Laurent Bigonville for the hint. + * Only fix permissions of configfiles on first install. + * debian/control: Fix typo in package description. Thanks to Julien Cristau + for spotting this. + + -- Ivo De Decker <ivo.dedec...@ugent.be> Thu, 20 Dec 2012 20:40:01 +0100 + +nut (2.6.4-2.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older + versions of the postinst (Closes: #677054) + + -- Sébastien Villemot <sebast...@debian.org> Mon, 26 Nov 2012 21:09:33 +0100 + +nut (2.6.4-2) unstable; urgency=low + + * debian/rules: Stop the nut-client before nut-server on systems using static + boot ordering (Closes: #679451) + * debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade + (Closes: #677822) + * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and + adjust overrides now that ups-monitor is shipped in nut-client package + (Closes: #677947) + * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched + regression (Taken from upstream) (Closes: #679513) + * Move nut metapackage to Section: metapackages + * Also create nut user when installing nut-client package and do not delete + it on purge anymore (Closes: #682000) + * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration + happends before squeeze release and this was against policy to have a + maintainer script modifying a conffile in the first place (Closes: #684392) + * Add dependency against adduser and lsb-base on nut-client package + * Be sure that client is stopped before the server also when using + dependencies based boot + * Fix package descriptions (Closes: #678068) + * Also install /bin/upssched-cmd in nut-client package as this script is + referenced in default upssched.conf config file + * debian/watch: Update watch file + * Be sure that all maintainer scripts are returning 0 at their end + + -- Laurent Bigonville <bi...@debian.org> Sun, 12 Aug 2012 20:38:52 +0200 + nut (2.6.4-1) unstable; urgency=high * New upstream release (Closes: #671444) diff -Nru nut-2.6.4/debian/control nut-2.6.4/debian/control --- nut-2.6.4/debian/control 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/control 2012-12-20 20:40:14.000000000 +0100 @@ -24,6 +24,7 @@ Package: nut Architecture: all +Section: metapackages Depends: ${misc:Depends}, nut-server, nut-client Description: network UPS tools - metapackage Network UPS Tools (NUT) is a client/server monitoring system that @@ -32,7 +33,8 @@ through the server, and are notified whenever the power status changes. . - This package is a metapackage that install both nut-server and nut-client + This package is a metapackage that installs both nut-server and nut-client, + in most cases it is sufficient for a basic UPS monitoring system. Package: nut-server Architecture: any @@ -50,12 +52,11 @@ changes. . This package provides NUT's core system, and the serial and USB UPS - drivers. In most cases it is sufficient for a basic UPS monitoring - system. + drivers. Package: nut-client Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) Provides: ups-monitor Conflicts: ups-monitor, nut-server (<< 2.6.3-1) Recommends: bash-completion diff -Nru nut-2.6.4/debian/gbp.conf nut-2.6.4/debian/gbp.conf --- nut-2.6.4/debian/gbp.conf 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/gbp.conf 2012-12-20 20:40:14.000000000 +0100 @@ -1,6 +1,6 @@ [DEFAULT] -debian-branch = debian -upstream-branch = upstream +debian-branch = debian-wheezy +upstream-branch = upstream-wheezy pristine-tar = True [git-buildpackage] diff -Nru nut-2.6.4/debian/nut-cgi.postrm nut-2.6.4/debian/nut-cgi.postrm --- nut-2.6.4/debian/nut-cgi.postrm 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-cgi.postrm 2012-12-20 20:40:14.000000000 +0100 @@ -44,3 +44,4 @@ #DEBHELPER# +exit 0 diff -Nru nut-2.6.4/debian/nut-client.install nut-2.6.4/debian/nut-client.install --- nut-2.6.4/debian/nut-client.install 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-client.install 2012-12-20 20:40:14.000000000 +0100 @@ -4,6 +4,7 @@ debian/tmp/bin/upscmd debian/tmp/sbin/upsmon debian/tmp/sbin/upssched +debian/tmp/bin/upssched-cmd debian/tmp/etc/bash_completion.d/nut debian/tmp/etc/nut/nut.conf debian/tmp/etc/nut/upsmon.conf diff -Nru nut-2.6.4/debian/nut-client.lintian-overrides nut-2.6.4/debian/nut-client.lintian-overrides --- nut-2.6.4/debian/nut-client.lintian-overrides 1970-01-01 01:00:00.000000000 +0100 +++ nut-2.6.4/debian/nut-client.lintian-overrides 2012-12-20 20:40:14.000000000 +0100 @@ -0,0 +1 @@ +nut-client: script-in-etc-init.d-not-registered-via-update-rc.d diff -Nru nut-2.6.4/debian/nut-client.postinst nut-2.6.4/debian/nut-client.postinst --- nut-2.6.4/debian/nut-client.postinst 1970-01-01 01:00:00.000000000 +0100 +++ nut-2.6.4/debian/nut-client.postinst 2012-12-20 20:40:14.000000000 +0100 @@ -0,0 +1,76 @@ +#!/bin/sh -e + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# fi + + # make sure that conffiles are secured and have the correct ownerships + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ + fi + for file in nut.conf upsmon.conf upssched.conf ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi + + # make sure that /var/run/nut exists and has the correct ownerships + if [ ! -d /var/run/nut ] ; then + mkdir -p /var/run/nut + fi + if [ -d /var/run/nut ] ; then + chown root:nut /var/run/nut + chmod 770 /var/run/nut + fi + + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi + update-rc.d nut remove >/dev/null + fi + ;; + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 diff -Nru nut-2.6.4/debian/nut-client.preinst nut-2.6.4/debian/nut-client.preinst --- nut-2.6.4/debian/nut-client.preinst 1970-01-01 01:00:00.000000000 +0100 +++ nut-2.6.4/debian/nut-client.preinst 2012-12-20 20:40:14.000000000 +0100 @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +# Revert /etc/nut/nut.conf mangling done by older versions of the postinst +# See #677054 +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then + sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf +fi + +#DEBHELPER# diff -Nru nut-2.6.4/debian/nut-server.init nut-2.6.4/debian/nut-server.init --- nut-2.6.4/debian/nut-server.init 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-server.init 2012-12-20 20:40:14.000000000 +0100 @@ -2,7 +2,7 @@ ### BEGIN INIT INFO # Provides: nut-server upsd # Required-Start: $local_fs $syslog $network $remote_fs udev -# Required-Stop: $local_fs $syslog $network $remote_fs udev nut-client +# Required-Stop: $local_fs $syslog $network $remote_fs udev # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Network UPS Tools initscript diff -Nru nut-2.6.4/debian/nut-server.lintian-overrides nut-2.6.4/debian/nut-server.lintian-overrides --- nut-2.6.4/debian/nut-server.lintian-overrides 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-server.lintian-overrides 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -nut-server: script-in-etc-init.d-not-registered-via-update-rc.d -nut-server: init.d-script-does-not-provide-itself etc/init.d/ups-monitor diff -Nru nut-2.6.4/debian/nut-server.postinst nut-2.6.4/debian/nut-server.postinst --- nut-2.6.4/debian/nut-server.postinst 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-server.postinst 2012-12-20 20:40:14.000000000 +0100 @@ -19,15 +19,18 @@ # fi # make sure that conffiles are secured and have the correct ownerships - if [ -d /etc/nut/ ] ; then - chown root:nut /etc/nut/ - fi - for file in nut.conf ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do - if [ -f /etc/nut/$file ] ; then - chown root:nut /etc/nut/$file - chmod 640 /etc/nut/$file + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ fi - done + for file in ups.conf upsd.conf upsd.users ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then @@ -50,67 +53,14 @@ # 557178 udevadm trigger --subsystem-match=usb - # migrate /etc/default/nut to /etc/nut/nut.conf (part #2) - if dpkg --compare-versions "$2" lt-nl "2.4.1-2" ; then - # source the temporary /etc/default/nut.bak file - if [ -f /etc/default/nut.bak ] ; then - . /etc/default/nut.bak - - # FIXME: use a template (and debconf to output?) - echo "migrating /etc/default/nut to /etc/nut/nut.conf" - - # pre process the config - case "$START_UPSD" in - y|Y|yes|YES|Yes) - START_UPSD=yes - ;; - *) - START_UPSD=no - ;; - esac - case "$START_UPSMON" in - y|Y|yes|YES|Yes) - START_UPSMON=yes - ;; - *) - START_UPSMON=no - ;; - esac - - # now process the result - if [ "x$START_UPSD" = "xyes" ] ; then - if [ "x$START_UPSMON" = "xyes" ] ; then - # can also be netserver - NUT_MODE=standalone - #else not processed since it should be an error! - fi + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut else - if [ "x$START_UPSMON" = "xyes" ] ; then - NUT_MODE=netclient - else - NUT_MODE=none - fi + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old fi - - # output back the MODE to nut.conf - sed "s/^MODE\(.*\)/MODE=$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new - - # append the content of default, removing START_* / start... - grep -iv 'START' /etc/default/nut.bak >> /etc/nut/nut.conf.new - # move back to nut.conf - mv /etc/nut/nut.conf.new /etc/nut/nut.conf - # and to init.d/nut - #if [ -f /etc/init.d/nut ] ; then - # sed "s/^UPSD_OPTIONS\(.*\)/UPSD_OPTIONS=\"$UPSD_OPTIONS\"/" /etc/init.d/nut > /etc/init.d/nut.new - # sed "s/^UPSMON_OPTIONS\(.*\)/UPSMON_OPTIONS=\"$UPSMON_OPTIONS\"/" /etc/init.d/nut.new > /etc/init.d/nut - #fi - rm -f /etc/default/nut.bak /etc/default/nut - fi - else - # re process nut.conf MODE so that it can be sourced - NUT_MODE=`grep -e '^ *MODE' /etc/nut/nut.conf | tr -d " "` - sed "s/^ *MODE.*/$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new - mv /etc/nut/nut.conf.new /etc/nut/nut.conf + update-rc.d nut remove >/dev/null fi ;; @@ -134,3 +84,5 @@ esac #DEBHELPER# + +exit 0 diff -Nru nut-2.6.4/debian/nut-server.postrm nut-2.6.4/debian/nut-server.postrm --- nut-2.6.4/debian/nut-server.postrm 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-server.postrm 2012-12-20 20:40:14.000000000 +0100 @@ -14,12 +14,6 @@ rm -f /etc/udev/rules.d/025_nut-usbups.rules rm -f /etc/udev/rules.d/52_nut-usbups.rules rm -f /etc/udev/rules.d/52-nut-usbups.rules - # remove the nut user - if [ -x "$(command -v deluser)" ]; then - deluser --quiet --system nut > /dev/null || true - else - echo >&2 "not removing nut system account because deluser command was not found" - fi # handle a dpkg bug [ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1 ;; @@ -53,3 +47,4 @@ #DEBHELPER# +exit 0 diff -Nru nut-2.6.4/debian/nut-server.preinst nut-2.6.4/debian/nut-server.preinst --- nut-2.6.4/debian/nut-server.preinst 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/nut-server.preinst 2012-12-20 20:40:14.000000000 +0100 @@ -5,13 +5,8 @@ [ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules [ -f /etc/udev/rules.d/52_nut-usbups.rules ] && rm -f /etc/udev/rules.d/52_nut-usbups.rules [ -f /etc/udev/rules.d/52-nut-usbups.rules ] && rm -f /etc/udev/rules.d/52-nut-usbups.rules - - # migrate /etc/default/nut to /etc/nut/nut.conf (part #1) - # we need to do this before default gets trashed - if [ -f /etc/default/nut ] ; then - # backup /etc/default/nut - cp /etc/default/nut /etc/default/nut.bak - fi fi #DEBHELPER# + +exit 0 diff -Nru nut-2.6.4/debian/patches/0001-fix-upsmon-regression.patch nut-2.6.4/debian/patches/0001-fix-upsmon-regression.patch --- nut-2.6.4/debian/patches/0001-fix-upsmon-regression.patch 1970-01-01 01:00:00.000000000 +0100 +++ nut-2.6.4/debian/patches/0001-fix-upsmon-regression.patch 2012-12-20 20:40:14.000000000 +0100 @@ -0,0 +1,15 @@ +Description: Fix upsmon/upssched regression +Origin: upstream, http://trac.networkupstools.org/projects/nut/changeset/3670 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679513 + +Index: /trunk/clients/upssched.c +=================================================================== +--- a/clients/upssched.c (revision 3555) ++++ b/clients/upssched.c (revision 3670) +@@ -695,5 +695,5 @@ + pconf_encode(arg2, enc, sizeof(enc))); + +- snprintfcat(enc, sizeof(enc), "%s\n", buf); ++ snprintf(enc, sizeof(enc), "%s\n", buf); + + /* see if the parent needs to be started (and maybe start it) */ diff -Nru nut-2.6.4/debian/patches/series nut-2.6.4/debian/patches/series --- nut-2.6.4/debian/patches/series 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/patches/series 2012-12-20 20:40:14.000000000 +0100 @@ -1 +1,2 @@ +0001-fix-upsmon-regression.patch 0002-nut-monitor-paths.patch diff -Nru nut-2.6.4/debian/rules nut-2.6.4/debian/rules --- nut-2.6.4/debian/rules 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/rules 2012-12-20 20:40:14.000000000 +0100 @@ -76,8 +76,8 @@ binary-install/nut-monitor:: dh_python2 -pnut-monitor -DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server -- start 50 2 3 4 5 . stop 50 0 1 6 . -DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client -- start 51 2 3 4 5 . stop 51 0 1 6 . +DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server -- start 50 2 3 4 5 . stop 51 0 1 6 . +DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client -- start 51 2 3 4 5 . stop 50 0 1 6 . DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf ifeq (linux,$(DEB_HOST_ARCH_OS)) diff -Nru nut-2.6.4/debian/watch nut-2.6.4/debian/watch --- nut-2.6.4/debian/watch 2012-06-06 21:06:03.000000000 +0200 +++ nut-2.6.4/debian/watch 2012-12-20 20:40:14.000000000 +0100 @@ -1,2 +1,2 @@ version=3 -http://www.networkupstools.org/source/2.4/nut-(.*)\.tar\.gz debian uupdate +http://www.networkupstools.org/source/([0-9.]+)/nut-(.*)\.tar\.gz
diff -Nru -w nut-2.6.4/debian/changelog nut-2.6.4/debian/changelog --- nut-2.6.4/debian/changelog 2012-11-26 21:09:33.000000000 +0100 +++ nut-2.6.4/debian/changelog 2012-12-20 20:40:14.000000000 +0100 @@ -1,3 +1,16 @@ +nut (2.6.4-2.2) unstable; urgency=low + + * Non-maintainer upload with fixes for wheezy. + * Only remove /etc/init.d/nut from previous versions of nut in nut-server + postinst if there are no local changes. + * Also remove /etc/init.d/nut in nut-client postinst. Thanks to + Laurent Bigonville for the hint. + * Only fix permissions of configfiles on first install. + * debian/control: Fix typo in package description. Thanks to Julien Cristau + for spotting this. + + -- Ivo De Decker <ivo.dedec...@ugent.be> Thu, 20 Dec 2012 20:40:01 +0100 + nut (2.6.4-2.1) unstable; urgency=low * Non-maintainer upload. diff -Nru -w nut-2.6.4/debian/control nut-2.6.4/debian/control --- nut-2.6.4/debian/control 2012-08-12 20:39:01.000000000 +0200 +++ nut-2.6.4/debian/control 2012-12-20 20:40:14.000000000 +0100 @@ -33,7 +33,7 @@ through the server, and are notified whenever the power status changes. . - This package is a metapackage that install both nut-server and nut-client, + This package is a metapackage that installs both nut-server and nut-client, in most cases it is sufficient for a basic UPS monitoring system. Package: nut-server diff -Nru -w nut-2.6.4/debian/nut-client.postinst nut-2.6.4/debian/nut-client.postinst --- nut-2.6.4/debian/nut-client.postinst 2012-08-12 20:39:01.000000000 +0200 +++ nut-2.6.4/debian/nut-client.postinst 2012-12-20 20:40:14.000000000 +0100 @@ -19,6 +19,8 @@ # fi # make sure that conffiles are secured and have the correct ownerships + # on first install + if [ -z "$2" ] ; then if [ -d /etc/nut/ ] ; then chown root:nut /etc/nut/ fi @@ -28,6 +30,7 @@ chmod 640 /etc/nut/$file fi done + fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then @@ -37,6 +40,16 @@ chown root:nut /var/run/nut chmod 770 /var/run/nut fi + + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi + update-rc.d nut remove >/dev/null + fi ;; abort-upgrade) diff -Nru -w nut-2.6.4/debian/nut-server.postinst nut-2.6.4/debian/nut-server.postinst --- nut-2.6.4/debian/nut-server.postinst 2012-08-12 20:39:01.000000000 +0200 +++ nut-2.6.4/debian/nut-server.postinst 2012-12-20 20:40:14.000000000 +0100 @@ -19,6 +19,8 @@ # fi # make sure that conffiles are secured and have the correct ownerships + # on first install + if [ -z "$2" ] ; then if [ -d /etc/nut/ ] ; then chown root:nut /etc/nut/ fi @@ -28,6 +30,7 @@ chmod 640 /etc/nut/$file fi done + fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then @@ -50,8 +53,13 @@ # 557178 udevadm trigger --subsystem-match=usb - if dpkg --compare-versions "$2" le "2.6.4-2~" ; then + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi update-rc.d nut remove >/dev/null fi ;;