commit:     a9911165da14ccb9a905b5f3e0b076a0f50b852b
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 15 18:31:27 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan 15 18:31:27 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a9911165

bin/install-qa-check.d/05prefix: silence grep for shebangs on binaries

Two birds one stone:
- silence grep on binary files if they happen to contain #!
- don't process binary files at all (because we only want text files)

While at it, also look for "# !" which is the official form to write the
shebang.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 bin/install-qa-check.d/05prefix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/install-qa-check.d/05prefix b/bin/install-qa-check.d/05prefix
index 03da3bbce..959c85b1b 100644
--- a/bin/install-qa-check.d/05prefix
+++ b/bin/install-qa-check.d/05prefix
@@ -51,7 +51,7 @@ install_qa_check_prefix() {
        fi
        # this is hell expensive, but how else?
        find "${ED%/}/" -executable \! -type d -print0 \
-                       | xargs -0 grep -H -n -m1 "^#!" \
+                       | xargs -0 grep -IHnm1 '^# \?!' \
                        | while read f ;
        do
                local fn=${f%%:*}

Reply via email to