Merge lp:~benji/launchpad/make-lint-ignore-grep-env into lp:launchpad

Proposed by Benji York
Status: Merged
Approved by: Leonard Richardson
Approved revision: no longer in the source branch.
Merged at revision: 12395
Proposed branch: lp:~benji/launchpad/make-lint-ignore-grep-env
Merge into: lp:launchpad
Diff against target: 12 lines (+1/-1)
1 file modified
buildout-templates/bin/lint.sh.in (+1/-1)
To merge this branch: bzr merge lp:~benji/launchpad/make-lint-ignore-grep-env
Reviewer Review Type Date Requested Status
Leonard Richardson (community) Approve
Review via email: mp+49884@code.launchpad.net

Commit message

[r=leonardr][no-qa] isolate bin/lint.sh's use of grep from the environment

Description of the change

This is a small change to the bin/lint.sh template to isolate grep from
the various environment variables that can affect its operation in ways
undesirable in the context of the script.

In particular, I have "-n" in my GREP_OPTIONS environment variable which
causes "make lint" to generate this exception (note the leading "1:"):

    Traceback (most recent call last):
    File "/usr/bin/pocketlint", line 6, in <module>
        sys.exit(main(sys.argv))
    File "/usr/lib/pymodules/python2.6/pocketlint/formatcheck.py", line 519, in main
        check_sources(sources, reporter)
    File "/usr/lib/pymodules/python2.6/pocketlint/formatcheck.py", line 500, in check_sources
        with open(file_path) as file_:
    IOError: [Errno 2] No such file or directory: '1:lib/canonical/launchpad/emailtemplates/bug-notification.txt'

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/lint.sh.in'
2--- buildout-templates/bin/lint.sh.in 2010-09-27 11:50:51 +0000
3+++ buildout-templates/bin/lint.sh.in 2011-02-15 21:57:08 +0000
4@@ -107,7 +107,7 @@
5
6
7 # Sample data contains auto generated files with long lines.
8-pocketlint_files=`echo "$files" | grep -v "$sample_dir"`
9+pocketlint_files=`echo "$files" | env -i grep -v "$sample_dir"`
10 if [ -z "$pocketlint_files" ]; then
11 exit 0
12 fi