Submitter | timeless@mozdev.org |
---|---|
Date | April 7, 2016, 1:26 a.m. |
Message ID | <16e6523533e263430f06.1459992397@waste.org> |
Download | mbox | patch |
Permalink | /patch/14409/ |
State | Accepted |
Delegated to: | Pierre-Yves David |
Headers | show |
Comments
On Wed, 06 Apr 2016 20:26:37 -0500, timeless wrote: > # HG changeset patch > # User timeless <timeless@mozdev.org> > # Date 1459969752 0 > # Wed Apr 06 19:09:12 2016 +0000 > # Node ID 16e6523533e263430f06ffd785c921a114268199 > # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e > tests: add new test for #! shbang lines ^^^^^^ perhaps sh"e"bang is more common > * use #!/bin/sh not e.g. #!/usr/bin/sh > * use #!/usr/bin/env python not e.g. #!/usr/bin/python > > diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t > copy from tests/test-check-execute.t > copy to tests/test-check-shbang.t > --- a/tests/test-check-execute.t > +++ b/tests/test-check-shbang.t > @@ -1,23 +1,13 @@ > -#require test-repo execbit > +#require test-repo > > $ cd "`dirname "$TESTDIR"`" > > -look for python scripts without the execute bit > +look for python scripts that do not use /usr/bin/env > > - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' > + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env python")' > [1] > > -look for python scripts with execute bit but not shebang > +look for shell scripts that do not use /bin/sh > > - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' > + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' > [1] My two cents, should we integrate this into check-code.py?
On 04/08/2016 07:34 AM, Yuya Nishihara wrote: > On Wed, 06 Apr 2016 20:26:37 -0500, timeless wrote: >> # HG changeset patch >> # User timeless <timeless@mozdev.org> >> # Date 1459969752 0 >> # Wed Apr 06 19:09:12 2016 +0000 >> # Node ID 16e6523533e263430f06ffd785c921a114268199 >> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >> tests: add new test for #! shbang lines > ^^^^^^ > perhaps sh"e"bang is more common I agree with yuyua here, I've changed this to shebang. >> * use #!/bin/sh not e.g. #!/usr/bin/sh >> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >> >> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >> copy from tests/test-check-execute.t >> copy to tests/test-check-shbang.t >> --- a/tests/test-check-execute.t >> +++ b/tests/test-check-shbang.t >> @@ -1,23 +1,13 @@ >> -#require test-repo execbit >> +#require test-repo >> >> $ cd "`dirname "$TESTDIR"`" >> >> -look for python scripts without the execute bit >> +look for python scripts that do not use /usr/bin/env >> >> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env python")' >> [1] >> >> -look for python scripts with execute bit but not shebang >> +look for shell scripts that do not use /bin/sh >> >> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >> [1] > My two cents, should we integrate this into check-code.py? Maybe, but the python shebang are not tested in checkcode either so I think it is fine to take this one as is.
On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: > # HG changeset patch > # User timeless <timeless@mozdev.org> > # Date 1459969752 0 > # Wed Apr 06 19:09:12 2016 +0000 > # Node ID 16e6523533e263430f06ffd785c921a114268199 > # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e > tests: add new test for #! shbang lines > > * use #!/bin/sh not e.g. #!/usr/bin/sh > * use #!/usr/bin/env python not e.g. #!/usr/bin/python > > diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t > copy from tests/test-check-execute.t > copy to tests/test-check-shbang.t > --- a/tests/test-check-execute.t > +++ b/tests/test-check-shbang.t > @@ -1,23 +1,13 @@ > -#require test-repo execbit > +#require test-repo > $ cd "`dirname "$TESTDIR"`" > -look for python scripts without the execute bit > +look for python scripts that do not use /usr/bin/env > - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' > + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env > python")' > [1] > -look for python scripts with execute bit but not shebang > +look for shell scripts that do not use /bin/sh > - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' > + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' > [1] Is there a way to lose these lines other than `grep -v`? $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' + obsolete feature not enabled but 110079 markers found! [1] (I'm a bit surprised nobody else is seeing this?)
On Fri, 15 Apr 2016 22:19:51 -0400, Matt Harbison wrote: > On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: > > # HG changeset patch > > # User timeless <timeless@mozdev.org> > > # Date 1459969752 0 > > # Wed Apr 06 19:09:12 2016 +0000 > > # Node ID 16e6523533e263430f06ffd785c921a114268199 > > # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e > > tests: add new test for #! shbang lines > > > > * use #!/bin/sh not e.g. #!/usr/bin/sh > > * use #!/usr/bin/env python not e.g. #!/usr/bin/python > > > > diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t > > copy from tests/test-check-execute.t > > copy to tests/test-check-shbang.t > > --- a/tests/test-check-execute.t > > +++ b/tests/test-check-shbang.t > > @@ -1,23 +1,13 @@ > > -#require test-repo execbit > > +#require test-repo > > $ cd "`dirname "$TESTDIR"`" > > -look for python scripts without the execute bit > > +look for python scripts that do not use /usr/bin/env > > - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' > > + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env > > python")' > > [1] > > -look for python scripts with execute bit but not shebang > > +look for shell scripts that do not use /bin/sh > > - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' > > + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' > > [1] > > Is there a way to lose these lines other than `grep -v`? > > $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' > + obsolete feature not enabled but 110079 markers found! > [1] 2>/dev/null ? > (I'm a bit surprised nobody else is seeing this?) I've never seen it without "run-tests.py -l", and it isn't always displayed even with "-l".
I hit them all the time. I've complained but never gotten any particular help in quieting them. When I suggested 2> /dev/null, I'm pretty sure someone complained. Also, I had to add them to quite a few places, which really sucked :( On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72@gmail.com> wrote: > On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: > >> # HG changeset patch >> # User timeless <timeless@mozdev.org> >> # Date 1459969752 0 >> # Wed Apr 06 19:09:12 2016 +0000 >> # Node ID 16e6523533e263430f06ffd785c921a114268199 >> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >> tests: add new test for #! shbang lines >> >> * use #!/bin/sh not e.g. #!/usr/bin/sh >> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >> >> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >> copy from tests/test-check-execute.t >> copy to tests/test-check-shbang.t >> --- a/tests/test-check-execute.t >> +++ b/tests/test-check-shbang.t >> @@ -1,23 +1,13 @@ >> -#require test-repo execbit >> +#require test-repo >> $ cd "`dirname "$TESTDIR"`" >> -look for python scripts without the execute bit >> +look for python scripts that do not use /usr/bin/env >> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env >> python")' >> [1] >> -look for python scripts with execute bit but not shebang >> +look for shell scripts that do not use /bin/sh >> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >> [1] > > > Is there a way to lose these lines other than `grep -v`? > > $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' > + obsolete feature not enabled but 110079 markers found! > [1] > > (I'm a bit surprised nobody else is seeing this?) > > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> On Apr 16, 2016, at 11:22 PM, timeless <timeless@gmail.com> wrote: > > I hit them all the time. I've complained but never gotten any > particular help in quieting them. When I suggested 2> /dev/null, I'm > pretty sure someone complained. Also, I had to add them to quite a few > places, which really sucked :( I'm not keen on throwing away stderr either. We could put a (?) on the end, since I don't really care what output is captured- it's the false positive that's annoying. I just wanted to make sure that there wasn't a real issue before burying it. (E.g., there something wrong with one of the perf tests where it doesn't seem to set HGRCPATH to empty properly on Windows, so it tries and fails to load keyring from the user hgrc, which shows as a diff. I want to fix that, not hide it.) >> On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72@gmail.com> wrote: >>> On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: >>> >>> # HG changeset patch >>> # User timeless <timeless@mozdev.org> >>> # Date 1459969752 0 >>> # Wed Apr 06 19:09:12 2016 +0000 >>> # Node ID 16e6523533e263430f06ffd785c921a114268199 >>> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >>> tests: add new test for #! shbang lines >>> >>> * use #!/bin/sh not e.g. #!/usr/bin/sh >>> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >>> >>> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >>> copy from tests/test-check-execute.t >>> copy to tests/test-check-shbang.t >>> --- a/tests/test-check-execute.t >>> +++ b/tests/test-check-shbang.t >>> @@ -1,23 +1,13 @@ >>> -#require test-repo execbit >>> +#require test-repo >>> $ cd "`dirname "$TESTDIR"`" >>> -look for python scripts without the execute bit >>> +look for python scripts that do not use /usr/bin/env >>> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >>> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env >>> python")' >>> [1] >>> -look for python scripts with execute bit but not shebang >>> +look for shell scripts that do not use /bin/sh >>> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >>> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>> [1] >> >> >> Is there a way to lose these lines other than `grep -v`? >> >> $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >> + obsolete feature not enabled but 110079 markers found! >> [1] >> >> (I'm a bit surprised nobody else is seeing this?) >> >> _______________________________________________ >> Mercurial-devel mailing list >> Mercurial-devel@mercurial-scm.org >> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
hrm, ok. well, it'd need to be (?), if you don't use obsolete markings in your repo, then the output wouldn't happen. so 2>&1 + (?) seems reasonable. It is a bunch of files though (I think at least 3). It definitely happens on linux too (gcc112 where I do my work). On Sat, Apr 16, 2016 at 11:40 PM, Matt Harbison <mharbison72@gmail.com> wrote: > >> On Apr 16, 2016, at 11:22 PM, timeless <timeless@gmail.com> wrote: >> >> I hit them all the time. I've complained but never gotten any >> particular help in quieting them. When I suggested 2> /dev/null, I'm >> pretty sure someone complained. Also, I had to add them to quite a few >> places, which really sucked :( > > I'm not keen on throwing away stderr either. We could put a (?) on the end, since I don't really care what output is captured- it's the false positive that's annoying. I just wanted to make sure that there wasn't a real issue before burying it. (E.g., there something wrong with one of the perf tests where it doesn't seem to set HGRCPATH to empty properly on Windows, so it tries and fails to load keyring from the user hgrc, which shows as a diff. I want to fix that, not hide it.) > > >>> On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72@gmail.com> wrote: >>>> On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: >>>> >>>> # HG changeset patch >>>> # User timeless <timeless@mozdev.org> >>>> # Date 1459969752 0 >>>> # Wed Apr 06 19:09:12 2016 +0000 >>>> # Node ID 16e6523533e263430f06ffd785c921a114268199 >>>> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >>>> tests: add new test for #! shbang lines >>>> >>>> * use #!/bin/sh not e.g. #!/usr/bin/sh >>>> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >>>> >>>> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >>>> copy from tests/test-check-execute.t >>>> copy to tests/test-check-shbang.t >>>> --- a/tests/test-check-execute.t >>>> +++ b/tests/test-check-shbang.t >>>> @@ -1,23 +1,13 @@ >>>> -#require test-repo execbit >>>> +#require test-repo >>>> $ cd "`dirname "$TESTDIR"`" >>>> -look for python scripts without the execute bit >>>> +look for python scripts that do not use /usr/bin/env >>>> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >>>> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env >>>> python")' >>>> [1] >>>> -look for python scripts with execute bit but not shebang >>>> +look for shell scripts that do not use /bin/sh >>>> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >>>> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>>> [1] >>> >>> >>> Is there a way to lose these lines other than `grep -v`? >>> >>> $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>> + obsolete feature not enabled but 110079 markers found! >>> [1] >>> >>> (I'm a bit surprised nobody else is seeing this?) >>> >>> _______________________________________________ >>> Mercurial-devel mailing list >>> Mercurial-devel@mercurial-scm.org >>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> On Apr 16, 2016, at 11:51 PM, timeless <timeless@gmail.com> wrote: > > hrm, ok. well, it'd need to be (?), > if you don't use obsolete markings in your repo, then the output > wouldn't happen. > > so 2>&1 + (?) seems reasonable. Since the tests also capture stderr, is the redirect even necessary? > > It is a bunch of files though (I think at least 3). > > It definitely happens on linux too (gcc112 where I do my work). > >> On Sat, Apr 16, 2016 at 11:40 PM, Matt Harbison <mharbison72@gmail.com> wrote: >> >>> On Apr 16, 2016, at 11:22 PM, timeless <timeless@gmail.com> wrote: >>> >>> I hit them all the time. I've complained but never gotten any >>> particular help in quieting them. When I suggested 2> /dev/null, I'm >>> pretty sure someone complained. Also, I had to add them to quite a few >>> places, which really sucked :( >> >> I'm not keen on throwing away stderr either. We could put a (?) on the end, since I don't really care what output is captured- it's the false positive that's annoying. I just wanted to make sure that there wasn't a real issue before burying it. (E.g., there something wrong with one of the perf tests where it doesn't seem to set HGRCPATH to empty properly on Windows, so it tries and fails to load keyring from the user hgrc, which shows as a diff. I want to fix that, not hide it.) >> >> >>>>> On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72@gmail.com> wrote: >>>>> On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: >>>>> >>>>> # HG changeset patch >>>>> # User timeless <timeless@mozdev.org> >>>>> # Date 1459969752 0 >>>>> # Wed Apr 06 19:09:12 2016 +0000 >>>>> # Node ID 16e6523533e263430f06ffd785c921a114268199 >>>>> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >>>>> tests: add new test for #! shbang lines >>>>> >>>>> * use #!/bin/sh not e.g. #!/usr/bin/sh >>>>> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >>>>> >>>>> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >>>>> copy from tests/test-check-execute.t >>>>> copy to tests/test-check-shbang.t >>>>> --- a/tests/test-check-execute.t >>>>> +++ b/tests/test-check-shbang.t >>>>> @@ -1,23 +1,13 @@ >>>>> -#require test-repo execbit >>>>> +#require test-repo >>>>> $ cd "`dirname "$TESTDIR"`" >>>>> -look for python scripts without the execute bit >>>>> +look for python scripts that do not use /usr/bin/env >>>>> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >>>>> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env >>>>> python")' >>>>> [1] >>>>> -look for python scripts with execute bit but not shebang >>>>> +look for shell scripts that do not use /bin/sh >>>>> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >>>>> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>>>> [1] >>>> >>>> >>>> Is there a way to lose these lines other than `grep -v`? >>>> >>>> $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>>> + obsolete feature not enabled but 110079 markers found! >>>> [1] >>>> >>>> (I'm a bit surprised nobody else is seeing this?) >>>> >>>> _______________________________________________ >>>> Mercurial-devel mailing list >>>> Mercurial-devel@mercurial-scm.org >>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Hrm, perhaps not. I'm so used to grep for which it was On Sun, Apr 17, 2016 at 12:03 AM, Matt Harbison <mharbison72@gmail.com> wrote: > >> On Apr 16, 2016, at 11:51 PM, timeless <timeless@gmail.com> wrote: >> >> hrm, ok. well, it'd need to be (?), >> if you don't use obsolete markings in your repo, then the output >> wouldn't happen. >> >> so 2>&1 + (?) seems reasonable. > > Since the tests also capture stderr, is the redirect even necessary? > >> >> It is a bunch of files though (I think at least 3). >> >> It definitely happens on linux too (gcc112 where I do my work). >> >>> On Sat, Apr 16, 2016 at 11:40 PM, Matt Harbison <mharbison72@gmail.com> wrote: >>> >>>> On Apr 16, 2016, at 11:22 PM, timeless <timeless@gmail.com> wrote: >>>> >>>> I hit them all the time. I've complained but never gotten any >>>> particular help in quieting them. When I suggested 2> /dev/null, I'm >>>> pretty sure someone complained. Also, I had to add them to quite a few >>>> places, which really sucked :( >>> >>> I'm not keen on throwing away stderr either. We could put a (?) on the end, since I don't really care what output is captured- it's the false positive that's annoying. I just wanted to make sure that there wasn't a real issue before burying it. (E.g., there something wrong with one of the perf tests where it doesn't seem to set HGRCPATH to empty properly on Windows, so it tries and fails to load keyring from the user hgrc, which shows as a diff. I want to fix that, not hide it.) >>> >>> >>>>>> On Fri, Apr 15, 2016 at 10:19 PM, Matt Harbison <mharbison72@gmail.com> wrote: >>>>>> On Wed, 06 Apr 2016 21:26:37 -0400, timeless <timeless@mozdev.org> wrote: >>>>>> >>>>>> # HG changeset patch >>>>>> # User timeless <timeless@mozdev.org> >>>>>> # Date 1459969752 0 >>>>>> # Wed Apr 06 19:09:12 2016 +0000 >>>>>> # Node ID 16e6523533e263430f06ffd785c921a114268199 >>>>>> # Parent 0a413e125a885f3b5349aa8aaa8d7285fbcbdd3e >>>>>> tests: add new test for #! shbang lines >>>>>> >>>>>> * use #!/bin/sh not e.g. #!/usr/bin/sh >>>>>> * use #!/usr/bin/env python not e.g. #!/usr/bin/python >>>>>> >>>>>> diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t >>>>>> copy from tests/test-check-execute.t >>>>>> copy to tests/test-check-shbang.t >>>>>> --- a/tests/test-check-execute.t >>>>>> +++ b/tests/test-check-shbang.t >>>>>> @@ -1,23 +1,13 @@ >>>>>> -#require test-repo execbit >>>>>> +#require test-repo >>>>>> $ cd "`dirname "$TESTDIR"`" >>>>>> -look for python scripts without the execute bit >>>>>> +look for python scripts that do not use /usr/bin/env >>>>>> - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' >>>>>> + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env >>>>>> python")' >>>>>> [1] >>>>>> -look for python scripts with execute bit but not shebang >>>>>> +look for shell scripts that do not use /bin/sh >>>>>> - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' >>>>>> + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>>>>> [1] >>>>> >>>>> >>>>> Is there a way to lose these lines other than `grep -v`? >>>>> >>>>> $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' >>>>> + obsolete feature not enabled but 110079 markers found! >>>>> [1] >>>>> >>>>> (I'm a bit surprised nobody else is seeing this?) >>>>> >>>>> _______________________________________________ >>>>> Mercurial-devel mailing list >>>>> Mercurial-devel@mercurial-scm.org >>>>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Patch
diff --git a/tests/test-check-execute.t b/tests/test-check-shbang.t copy from tests/test-check-execute.t copy to tests/test-check-shbang.t --- a/tests/test-check-execute.t +++ b/tests/test-check-shbang.t @@ -1,23 +1,13 @@ -#require test-repo execbit +#require test-repo $ cd "`dirname "$TESTDIR"`" -look for python scripts without the execute bit +look for python scripts that do not use /usr/bin/env - $ hg files 'set:**.py and not exec() and grep(r"^#!.*?python")' + $ hg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bin/env python")' [1] -look for python scripts with execute bit but not shebang +look for shell scripts that do not use /bin/sh - $ hg files 'set:**.py and exec() and not grep(r"^#!.*?python")' + $ hg files 'set:grep(r"^#!.*/bin/sh") and not grep(r"^#!/bin/sh")' [1] - -look for shell scripts with execute bit but not shebang - - $ hg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")' - [1] - -look for non scripts with no shebang - - $ hg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")' - [1]