[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Intended MBF: maintainer scripts not using strict mode



Hello,

On Mon, Jun 26, 2017 at 10:23:56PM +0200, Ralf Treinen wrote:

> we currently have in sid 84 maintainer scripts not using strict mode.
> That is, they neither start on "#!/bin/[ba]sh -e", nor do a "set -e".

Thanks to everybody for your feedback. I guess I will stick with
severity=normal for the moment. The MBF template, list of offending
maintainer scripts, and dd-list are attached.

-Ralf.
Dear maintainer,

at least one of the maintainer scripts (preinst, postinst, prerm, postrm) of the package #PACKAGE# does not use strict mode. Policy section 10.4 says:

  Shell scripts (sh and bash) [..] should almost certainly start with set -e so that errors are detected.

  Every script should use set -e or check the exit status of every command.

Please insert a "set -e" at the beginning of your script to enable strict mode. You should not replace this by a first line "#!/bin/sh -e" as it is not effective when your script is executed by an explicit invocation of sh.

Note that this might make your script fail in cases where it did not fail before. This is the purpose of strict mode - make it fail when any unexpected error is encountered. You should make sure that you catch any error (non-zero exit codes of commands) that you decide to tolerate. Techniques to locally catch an error include using appropriate options to your command when available, adding a " || true" at the end of the command, or selectively switching off strict mode by "set +e" and switching it back on again later by "set -e". 

This bug filing has been discussed and approved in thread [1].

-Ralf.

[1] https://lists.debian.org/debian-devel/2017/06/msg00342.html
asterisk-prompt-de_2.0-1.1/preinst
authbind_2.1.2/postinst
authbind_2.1.2/prerm
bcache-tools_1.0.8-2+b1/preinst
bible-kjv_4.29+b1/postinst
bible-kjv_4.29+b1/postrm
bible-kjv_4.29+b1/prerm
bible-kjv-text_4.29/postinst
bible-kjv-text_4.29/prerm
bind9_1:9.10.3.dfsg.P4-12.3/postrm
binfmtc_0.17-2+b1/postinst
binfmtc_0.17-2+b1/postrm
bwbar_1.2.3-2.1+b2/prerm
ca-certificates-mono_4.6.2.7+dfsg-1/postinst
checksecurity_2.0.16+nmu1/preinst
clips_6.24-3.2/postinst
cxref_1.6e-2+b1/postrm
debbugs_2.4.1.1/postrm
debfoster_2.7-2.1+b1/postrm
discover_2.1.2-7.1/postrm
discover_2.1.2-7.1/preinst
dsh_0.25.10-1.3/postinst
dsh_0.25.10-1.3/postrm
dsh_0.25.10-1.3/preinst
dvifb_1:01.03-14.2/postinst
dvifb_1:01.03-14.2/postrm
geki3_1.0.3-8.1/postinst
geki3_1.0.3-8.1/postrm
gjiten_2.6-3/postinst
gnukhata-core-engine_2.6.1-3/postrm
golang-godebiancontrol-dev_0.0~git20140119-1/preinst
guidedog_1.2.0-3+b1/postrm
hyperspec_1.30+nmu2/postinst
kterm_6.2.0-46.2/postinst
kterm_6.2.0-46.2/prerm
ldp-docbook-xsl_0.0.20040321-3/preinst
ldp-docbook-xsl_0.0.20040321-3/prerm
libclips_6.24-3.2/postinst
libclips_6.24-3.2/prerm
linpac_0.24-1+b1/postrm
logtool_1.2.8-10/postrm
logtool_1.2.8-10/preinst
lpr_1:2008.05.17.2+b1/postinst
lpr_1:2008.05.17.2+b1/postrm
manpages-posix-dev_2013a-2/postinst
manpages-posix-dev_2013a-2/postrm
manpages-posix-dev_2013a-2/preinst
mgetty-docs_1.1.36-3/preinst
mgetty-fax_1.1.36-3+b1/preinst
mgetty-voice_1.1.36-3+b1/postrm
mime-support_3.60/prerm
pmw-doc_1:4.29-1/postinst
pmw-doc_1:4.29-1/preinst
python-imaging-doc-html_1.1.2-1.2/postinst
python-imaging-doc-pdf_1.1.2-1.2/postinst
python-kde4_4:4.14.3-2/postinst
remembrance-agent_2.12-7+b2/prerm
samba_2:4.6.5+dfsg-2/prerm
samba-common-bin_2:4.6.5+dfsg-2/prerm
samhain_4.1.4-2/preinst
sauce_0.9.0+nmu3/postrm
scalable-cyrfonts-tex_4.17/postinst
scalable-cyrfonts-tex_4.17/postrm
scanlogd_2.2.5-3.3/postinst
scanlogd_2.2.5-3.3/postrm
scanlogd_2.2.5-3.3/prerm
sendfile_2.1b.20080616-5.3+b3/preinst
simba_0.8.4-4.3/postrm
spacearyarya_1.0.2-7.1/postinst
spacearyarya_1.0.2-7.1/postrm
suricata_4.0.0-beta1-1~exp1/preinst
swapspace_1.10-4+b2/postinst
t1-cyrillic_4.17/postrm
t1-oldslavic_4.17/postinst
t1-oldslavic_4.17/postrm
t1-teams_4.17/postinst
t1-teams_4.17/postrm
websimba_0.8.4-4.3/postinst
websimba_0.8.4-4.3/postrm
whizzytex_1.3.2-1.3/prerm
wodim_9:1.1.11-3+b2/preinst
Adam Majer <adamm@zombino.com>
   lpr

Andreas Barth <aba@ayous.org>
   mgetty

Andreas Barth <aba@not.so.argh.org>
   debfoster (U)

Andrew Bartlett <abartlet+debian@catalyst.net.nz>
   samba (U)

Anton Zinoviev <zinoviev@debian.org>
   scalable-cyrfonts

Antonio Cardoso Martins <digiplan.pt@gmail.com>
   guidedog

Ardo van Rangelrooij <ardo@debian.org>
   ldp-docbook-stylesheets (U)

Arturo Borrero Gonzalez <arturo@debian.org>
   suricata (U)

Balasankar C <balasankarc@autistici.org>
   gnukhata-core-engine

Botond Botyanszki <b0ti@users.sourceforge.net>
   gjiten

Camm Maguire <camm@debian.org>
   cxref

Charles Plessy <plessy@debian.org>
   mime-support (U)

Colin Tuckley <colint@debian.org>
   linpac (U)

Colin Watson <cjwatson@debian.org>
   debbugs (U)

David Mohr <david@mcbf.net>
   bcache-tools

David Nusinow <dnusinow@debian.org>
   discover (U)

Debbugs developers <debian-debbugs@lists.debian.org>
   debbugs

debfoster Maintainer Team <pkg-debfoster@teams.debian.net>
   debfoster

Debian Common Lisp Team <pkg-common-lisp-devel@lists.alioth.debian.org>
   hyperspec

Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
   geki3
   spacearyarya

Debian Hamradio Maintainers <debian-hams@lists.debian.org>
   linpac

Debian Install System Team <debian-boot@lists.debian.org>
   discover

Debian Mono Group <pkg-mono-group@lists.alioth.debian.org>
   mono

Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
   pykde4

Debian Samba Maintainers <pkg-samba-maint@lists.alioth.debian.org>
   samba

Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org>
   ldp-docbook-stylesheets

Don Armstrong <don@debian.org>
   debbugs (U)

Eduard Bloch <blade@debian.org>
   cdrkit (U)

Eugene V. Lyubimkin <jackyf.devel@gmail.com>
   swapspace

Florian Weimer <fw@deneb.enyo.de>
   debfoster (U)

Francesco Paolo Lovergine <frankie@debian.org>
   manpages-posix

Gaudenz Steinlin <gaudenz@debian.org>
   discover (U)

Gianfranco Costamagna <locutusofborg@debian.org>
   guidedog (U)

Ian Jackson <ian@davenant.greenend.org.uk>
   sauce

Ian Jackson <ijackson@chiark.greenend.org.uk>
   authbind

ISHIKAWA Mutsumi <ishikawa@debian.org>
   kterm

Ivo De Decker <ivodd@debian.org>
   samba (U)

Javier Fernandez-Sanguino Pen~a <jfs@computer.org>
   remem

Javier Fernandez-Sanguino Pen~a <jfs@debian.org>
   clips

Javier Fernández-Sanguino Peña <jfs@computer.org>
   checksecurity

Javier Fernández-Sanguino Peña <jfs@debian.org>
   samhain

Jelmer Vernooij <jelmer@debian.org>
   samba (U)

Jo Shields <directhex@apebox.org>
   mono (U)

Joerg Jaspert <joerg@debian.org>
   cdrkit

Julien Danjou <acid@debian.org>
   bwbar

Junichi Uekawa <dancer@debian.org>
   binfmtc
   dsh
   whizzytex

LaMont Jones <lamont@debian.org>
   bind9

Laszlo Boszormenyi (GCS) <gcs@debian.hu>
   mime-support (U)

Ludovic Drolez <ldrolez@debian.org>
   gjiten (U)

Marc Haber <mh+debian-packages@zugschlus.de>
   debfoster (U)

Mario Joussen <joussen@debian.org>
   asterisk-prompt-de

Martin Schulze <joey@debian.org>
   sendfile

Mathieu Parent <sathieu@debian.org>
   samba (U)

Matthew Vernon <matthew@debian.org>
   bible-kjv

Maximiliano Curia <maxy@debian.org>
   pykde4 (U)

Michael Gilbert <mgilbert@debian.org>
   bind9 (U)

Michael Meskes <meskes@debian.org>
   pykde4 (U)

Michael Stapelberg <stapelberg@debian.org>
   golang-godebiancontrol-dev

Michael Vogt <mvo@debian.org>
   scanlogd

Mime-Support Maintainers <mime-support@plessy.org>
   mime-support

Mirco Bauer <meebey@debian.org>
   mono (U)

Modestas Vainius <modax@debian.org>
   pykde4 (U)

Otavio Salvador <otavio@debian.org>
   discover (U)

Peter Van Eynde <pvaneynd@debian.org>
   hyperspec (U)

Petter Reinholdtsen <pere@debian.org>
   discover (U)

Pierre Chifflier <pollux@debian.org>
   suricata

Pirate Praveen <praveen@debian.org>
   gnukhata-core-engine (U)

Radu Spineanu <radu@debian.org>
   simba

Robie Basak <robie.basak@canonical.com>
   bind9 (U)

Robie Basak <robie@justgohome.co.uk>
   bcache-tools (U)

Sam Hocevar (Debian packages) <sam+deb@zoy.org>
   geki3 (U)
   spacearyarya (U)
   tmview

Simon Richter <sjr@debian.org>
   python-imaging-doc-handbook

Steve Langasek <vorlon@debian.org>
   samba (U)

Steve McIntyre <93sam@debian.org>
   cdrkit (U)

Sune Vuorela <sune@debian.org>
   pykde4 (U)

Wouter Verhelst <wouter@debian.org>
   logtool
   pmw


Reply to: