Subject: Bug#866297: bible-kjv-text: maintainer script(s) not using strict mode

From: [email-masked]
Date: Wed, 28 Jun 2017 21:02:46 +0200

Package: bible-kjv-text
Version: 4.29
Severity: normal
User: [email-masked]
Usertags: colis-shparser

Dear maintainer,

at least one of the maintainer scripts (preinst, postinst, prerm,
postrm) of the package bible-kjv-text 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

---

From: [email-masked] (Debian Bug Tracking System)
Date: Wed, 28 Jun 2017 19:32:11 +0000

Thank you for filing a new Bug report with Debian.

This is an automatically generated reply to let you know your message
has been received.

Your message has been forwarded to the package maintainers (but not
other interested parties, as you requested) for their attention; they
will reply in due course.

Your message has been sent to the package maintainer(s):
 Matthew Vernon <[email-masked]>

If you wish to submit further information on this problem, please
send it to [email-masked].

Please do not send mail to [email-masked] unless you wish
to report a problem with the Bug-tracking system.

-- 
866297: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866297
Debian Bug Tracking System
Contact [email-masked] with problems