diff options
author | Greg Price <gnprice@gmail.com> | 2019-09-09 07:16:33 -0700 |
---|---|---|
committer | T. Wouters <thomas@python.org> | 2019-09-09 07:16:33 -0700 |
commit | fa3a38d81faaf96d17b5a7f0248b9923e3a648cc (patch) | |
tree | 74faa96e40adef28fdfefd89a318cf2806807c5f | |
parent | e3c59a75279b0df4e7553d6f0031e202de434e43 (diff) | |
download | cpython-git-fa3a38d81faaf96d17b5a7f0248b9923e3a648cc.tar.gz |
Mark files as executable that are meant as scripts. (GH-15354)
This is the converse of GH-15353 -- in addition to plenty of
scripts in the tree that are marked with the executable bit
(and so can be directly executed), there are a few that have
a leading `#!` which could let them be executed, but it doesn't
do anything because they don't have the executable bit set.
Here's a command which finds such files and marks them. The
first line finds files in the tree with a `#!` line *anywhere*;
the next-to-last step checks that the *first* line is actually of
that form. In between we filter out files that already have the
bit set, and some files that are meant as fragments to be
consumed by one or another kind of preprocessor.
$ git grep -l '^#!' \
| grep -vxFf <( \
git ls-files --stage \
| perl -lane 'print $F[3] if (!/^100644/)' \
) \
| grep -ve '\.in$' -e '^Doc/includes/' \
| while read f; do
head -c2 "$f" | grep -qxF '#!' \
&& chmod a+x "$f"; \
done
-rwxr-xr-x[-rw-r--r--] | Lib/pydoc.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Lib/turtledemo/__main__.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Lib/turtledemo/sorting_animate.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Misc/python-wing3.wpr | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Misc/python-wing4.wpr | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Misc/python-wing5.wpr | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | PCbuild/fix_encoding.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | PCbuild/get_external.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | PCbuild/prepare_ssl.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Parser/asdl_c.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Tools/scripts/generate_token.py | 0 |
11 files changed, 0 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 9a22e56686..9a22e56686 100644..100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 17fe9a75e1..17fe9a75e1 100644..100755 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py diff --git a/Lib/turtledemo/sorting_animate.py b/Lib/turtledemo/sorting_animate.py index d25a0ab6ce..d25a0ab6ce 100644..100755 --- a/Lib/turtledemo/sorting_animate.py +++ b/Lib/turtledemo/sorting_animate.py diff --git a/Misc/python-wing3.wpr b/Misc/python-wing3.wpr index abe789412d..abe789412d 100644..100755 --- a/Misc/python-wing3.wpr +++ b/Misc/python-wing3.wpr diff --git a/Misc/python-wing4.wpr b/Misc/python-wing4.wpr index 7adfdbdacf..7adfdbdacf 100644..100755 --- a/Misc/python-wing4.wpr +++ b/Misc/python-wing4.wpr diff --git a/Misc/python-wing5.wpr b/Misc/python-wing5.wpr index 0e1ae63543..0e1ae63543 100644..100755 --- a/Misc/python-wing5.wpr +++ b/Misc/python-wing5.wpr diff --git a/PCbuild/fix_encoding.py b/PCbuild/fix_encoding.py index 60a892a4f7..60a892a4f7 100644..100755 --- a/PCbuild/fix_encoding.py +++ b/PCbuild/fix_encoding.py diff --git a/PCbuild/get_external.py b/PCbuild/get_external.py index a682d3849f..a682d3849f 100644..100755 --- a/PCbuild/get_external.py +++ b/PCbuild/get_external.py diff --git a/PCbuild/prepare_ssl.py b/PCbuild/prepare_ssl.py index 0f3c63ee24..0f3c63ee24 100644..100755 --- a/PCbuild/prepare_ssl.py +++ b/PCbuild/prepare_ssl.py diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index f4fa271b65..f4fa271b65 100644..100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py diff --git a/Tools/scripts/generate_token.py b/Tools/scripts/generate_token.py index f2745e8353..f2745e8353 100644..100755 --- a/Tools/scripts/generate_token.py +++ b/Tools/scripts/generate_token.py |