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

Bug#568926: marked as done (lintian seems to insist on set -e and doesn't like #!/bin/sh -e)



Your message dated Tue, 9 Feb 2010 22:28:24 +0100
with message-id <20100209212824.GA29219@anguilla.debian.or.at>
and subject line Re: Bug#568926: lintian seems to insist on set -e and doesn't like #!/bin/sh -e
has caused the Debian Bug report #568926,
regarding lintian seems to insist on set -e and doesn't like #!/bin/sh -e
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 owner@bugs.debian.org
immediately.)


-- 
568926: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568926
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: lintian
Version: 2.3.2
Severity: normal

	Hi!

 In a maintainerscript that starts off with "#!/bin/sh -e" an additional
"set -e" doesn't make much sense - though it seems like lintian insists
on this style. It would be pretty convenient if lintian would allow
handing the -e on the shebang line too.

 Thanks!
Rhonda



--- End Message ---
--- Begin Message ---
	Hi!

* Russ Allbery <rra@debian.org> [2010-02-09 21:32:24 CET]:
> Gerfried Fuchs <rhonda@deb.at> writes:
> >  Ah, now I see the difference. Though, I'd like to challenge the
> > explenation:
> 
> >  This is fine for normal operation, but if the script is run by
> >  hand with "sh /path/to/script" (common in debugging), "-e"
> >  will not be in effect.  It's therefore better to use "set -e" in
> >  the body of the script.
> 
> >  This explenation assumes that all scripts are posix compliant shell
> > scripts - which they don't have to be. They can be bash scripts or perl
> > scripts too. Given that one *has* to check what type of script it is
> > (like, head -1 script) it is directly visible from there that -e is set.
> 
> Hm, well, for maintainer scripts, I usually just use sh script, since
> nearly all of them are POSIX.  But the same thing would apply if one
> routinely ran bash script.  I don't recall ever running head -1 to see
> what type of script it is unless that blew up.  (We do have some Perl
> scripts, but they're fairly rare.)
> 
> The problem that Lintian is recommending to avoid is that since set -e
> changes the behavior in some fundamental ways, it can happen that running
> sh script will "work" when running the script directly doesn't, which is
> very confusing.

 Thanks for your time - I thought a bit longer about it and because the
message only turns up when one runs the --pedantic checks it is indeed
right to keep it there.

 Sorry for the noise, maybe the bug can be recycled when one thinks
about it again. :)

 Have fun!
Rhonda


--- End Message ---

Reply to: