Skip to content

Commit

Permalink
Remove executable bit & shebang where not needed
Browse files Browse the repository at this point in the history
This ensures scripts aren't accidentally called like binaries instead
of through the interpreter, minimizing the amount of locations where a
different interpreter location might cause issues.
  • Loading branch information
airtower-luna committed Apr 7, 2024
1 parent 7e5832c commit fddc737
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 31 deletions.
10 changes: 4 additions & 6 deletions test/apache-conf/required-modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
import os
import re
import subprocess
Expand All @@ -14,8 +13,7 @@
built_in_modules = set()
mod_re = re.compile(r'^\s+mod_(\w+)\.c')
for line in result.stdout.splitlines():
m = mod_re.match(line)
if m:
if (m := mod_re.match(line)):
built_in_modules.add(m.group(1))

for mod in (required_modules - built_in_modules):
Expand All @@ -25,7 +23,7 @@
mpm_choices = ['event', 'worker']
mod_dir = Path(os.environ['AP_LIBEXECDIR'])
for mpm in mpm_choices:
mod = mod_dir.joinpath(f'mod_mpm_{mpm}.so')
if mod.exists():
print(f'LoadModule\tmpm_{mpm}_module\t{mod!s}')
mod_lib = mod_dir / f'mod_mpm_{mpm}.so'
if mod_lib.exists():
print(f'LoadModule\tmpm_{mpm}_module\t{mod_lib!s}')
break
2 changes: 0 additions & 2 deletions test/check_test_ips.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

# Copyright 2020 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion test/doctest-mgstest.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
import doctest
import importlib
import mgstest
Expand Down
4 changes: 2 additions & 2 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ test('integration', python, args: [tap_py],
verbose: true,
depends: [test_pki, test_dirs, mod_gnutls, listen_conf, modules_conf])

test('doctest', doctest,
test('doctest', python, args: [doctest],
env: env,
depends: [test_pki, mod_gnutls])

test('unittest', unittest,
test('unittest', python, args: [unittest],
env: env,
depends: [test_pki, mod_gnutls])

Expand Down
4 changes: 1 addition & 3 deletions test/mgstest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/python3

# Copyright 2019-2020 Fiona Klute
# Copyright 2019-2024 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 1 addition & 3 deletions test/mgstest/http.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/python3

# Copyright 2019-2020 Fiona Klute
# Copyright 2019-2024 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 0 additions & 2 deletions test/mgstest/ocsp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python3

# Copyright 2020 Krista Karppinen
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 1 addition & 3 deletions test/mgstest/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/python3

# Copyright 2019-2020 Fiona Klute
# Copyright 2019-2024 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 1 addition & 4 deletions test/runtest.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/python3
# PYTHON_ARGCOMPLETE_OK

# Copyright 2019-2020 Fiona Klute
# Copyright 2019-2024 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
3 changes: 0 additions & 3 deletions test/softhsm-init.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/python3
# PYTHON_ARGCOMPLETE_OK

# Copyright 2020 Fiona Klute
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion test/tests/24_pkcs11_cert/hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
import os
import mgstest.softhsm
from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion test/unittest-mgstest.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python3
import os
import sys
import unittest
Expand Down

0 comments on commit fddc737

Please sign in to comment.