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

Bug#912912: marked as done (lintian: please detect for loops without set -e)



Your message dated Thu, 8 Nov 2018 19:18:33 +0100
with message-id <20181108181832.GQ2652@mapreri.org>
and subject line Re: Bug#912912: lintian: please detect for loops without set -e
has caused the Debian Bug report #912912,
regarding lintian: please detect for loops without set -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.)


-- 
912912: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912912
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: lintian
Severity: wishlist

See #912910 - I think these situations could easily be detected by
lintian, and marked with an E-tag when d/rules doesn't.

Reference: Policy §4.6


bad bad bad:
    for var in $(things_to_to_loop_on); do \
        $(whatever); \
    done

"good":
    set -e ; for var in $(things_to_to_loop_on); do \
        $(whatever); \
    done


Note however that the set -e could be omitted if one has

    SHELL=sh -e

or

    .SHELLFLAGS=-ec

or similar (even if *personally* I find using such means somewhat
obscure).

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
On Sun, Nov 04, 2018 at 05:41:51PM -0500, Chris Lamb wrote:
> Not wishing to play severity wars but I think E-tag would be a
> little aggressive for such a tag,

The E was mostly because it's a fairly important bug, potentially RC
that could cause quite some headaches while debugging, that was the
logic behind my suggestion.

> but I  worry we would expect a
> large number of false-positives. For example:
> 
>      for var in $(things_to_to_loop_on); do \
>          $(whatever) || exit $?; \
>      done
> 
> I mean, this exact code exists in disorderfs (albeit in tests/
> Makefile, not debian/rules).

Helmut did told me the same things…

> > Note however that the set -e could be omitted if one has
>  
> Detecting SHELL=sh -e and .SHELLFLAGS=-ec reliably too would only
> complicate such things.

TBH, I mostly hoped that in the time you have been maintaining lintian
you figured a why to reduce such false positives, but I understand
statically parsing makefiles is not exactly simple and accurate...

> Could you perhaps run some codesearch.debian.net queries to see
> what kind of false-positives we could expect? There will definitely
> be some, but if it's above "some" threshold I think this might be
> beyond Lintian's reach, alas.

I haven't done such search, but for now I'll just close this report.
Thanks for reading it nonetheless!

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Reply to: