Your message dated Tue, 07 Apr 2015 22:05:22 +0200
with message-id <55243882.5080...@debian.org>
and subject line Re: Bug#770335: Improvement of debian maintainer scripts 
proposal
has caused the Debian Bug report #770335,
regarding Improvement of debian maintainer scripts proposal
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
770335: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770335
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: rsyslog
Version: 8.4.2-1

I am repackaging rsyslog and used your maintainer scripts. These are
sometimes failing as they are missing the default "exit 0" command on
the end.

For example preinst:

#!/bin/sh

set -e

if [ "$1" = "install" ] && [ -n "$2" ] ; then
        [ -f /etc/logrotate.d/rsyslog.disabled ] && mv -f
/etc/logrotate.d/rsyslog.disabled /etc/logrotate.d/rsyslog
fi

if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.7.8-1" ; then
        rm -f /etc/systemd/system/sockets.target.wants/rsyslog.socket
fi

# In wheezy we ship the syslog.service symlink directly in the package, in
# jessie we use init-system-helpers to create it dynamically in postinst.
# During the upgrade there is a time frame when the symlink does not exist.
# If systemd is reloaded at this point, it loses track of the rsyslogd process.
# To work around this problem, create a (runtime) copy of the syslog.service
# symlink before the upgrade and remove it again afterwards. See #724796
if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "7.4.1-2" ; then
        if [ -d /run/systemd/system ] && [ -L
/etc/systemd/system/syslog.service ] ; then
                ln -sf /lib/systemd/system/rsyslog.service
/run/systemd/system/syslog.service
        fi
fi

This will fail if all the "if" statements will not match.

I would propose you to use the debhelper's default scripts (see the
"exit 0" on the end):

#!/bin/sh
# preinst script for rsyslog
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    install|upgrade)
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

It's a little effort and will increase quality of rsyslog packaging.

Best regards,
-- 
Peter Viskup

--- End Message ---
--- Begin Message ---
Am 20.11.2014 um 15:36 schrieb Peter Viskup:
> Package: rsyslog
> Version: 8.4.2-1
> 
> I am repackaging rsyslog and used your maintainer scripts. These are
> sometimes failing as they are missing the default "exit 0" command on
> the end.
> 
> For example preinst:
> 
> #!/bin/sh
> 
> set -e
> 
> if [ "$1" = "install" ] && [ -n "$2" ] ; then
>         [ -f /etc/logrotate.d/rsyslog.disabled ] && mv -f
> /etc/logrotate.d/rsyslog.disabled /etc/logrotate.d/rsyslog
> fi
> 
> if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.7.8-1" ; then
>         rm -f /etc/systemd/system/sockets.target.wants/rsyslog.socket
> fi
> 
> # In wheezy we ship the syslog.service symlink directly in the package, in
> # jessie we use init-system-helpers to create it dynamically in postinst.
> # During the upgrade there is a time frame when the symlink does not exist.
> # If systemd is reloaded at this point, it loses track of the rsyslogd 
> process.
> # To work around this problem, create a (runtime) copy of the syslog.service
> # symlink before the upgrade and remove it again afterwards. See #724796
> if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "7.4.1-2" ; then
>         if [ -d /run/systemd/system ] && [ -L
> /etc/systemd/system/syslog.service ] ; then
>                 ln -sf /lib/systemd/system/rsyslog.service
> /run/systemd/system/syslog.service
>         fi
> fi
> 
> This will fail if all the "if" statements will not match.
> 
> I would propose you to use the debhelper's default scripts (see the
> "exit 0" on the end):
> 
> #!/bin/sh
> # preinst script for rsyslog
> #
> # see: dh_installdeb(1)
> 
> set -e
> 
> # summary of how this script can be called:
> #        * <new-preinst> `install'
> #        * <new-preinst> `install' <old-version>
> #        * <new-preinst> `upgrade' <old-version>
> #        * <old-preinst> `abort-upgrade' <new-version>
> # for details, see http://www.debian.org/doc/debian-policy/ or
> # the debian-policy package
> 
> 
> case "$1" in
>     install|upgrade)
>     ;;
> 
>     abort-upgrade)
>     ;;
> 
>     *)
>         echo "preinst called with unknown argument \`$1'" >&2
>         exit 1
>     ;;
> esac
> 
> # dh_installdeb will replace this with shell code automatically
> # generated by other debhelper scripts.
> 
> #DEBHELPER#
> 
> exit 0
> 

"exit 0" was removed on purpose, because it makes no sense when used in
combination with "set -e".

commit 6fb5bc2c776fafb0746b47d8c770868b95da855c
Author: Michael Biebl <bi...@debian.org>
Date:   Thu Feb 13 18:52:45 2014 +0100

    Drop useless "exit 0" from maintainer scripts

    We use "set -e" everywhere.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to