meson: Rework the script execution logic

Using executable scripts with shebang is risky on UNIX, where python3
may not be present. Instead, use find_program('python3'), which Meson
provides a fallback for if it cannot find it in the environment.
This commit is contained in:
Ole André Vadla Ravnås committed 2024-04-23 10:50:51 +02:00
1 parent 27e70884ab
commit 025b422cfe
7 files changed
+13 -19

No files matched your search

Executable → Regular
+4 -7
View File
@@ -1,16 +1,13 @@
#!/usr/bin/env python3
import json
from pathlib import Path
import sys
def main(argv):
pkg_file = Path(argv[1])
pkg_data = json.loads(pkg_file.read_text(encoding="utf-8"))
def main():
root_dir = Path(__file__).parent.parent.resolve()
pkg_data = json.loads((root_dir / "package.json").read_text(encoding="utf-8"))
version = pkg_data["version"]
if version == "0.0.0":
root_dir = Path(__file__).parent.parent.resolve()
sys.path.insert(0, str(root_dir))
from releng.frida_version import detect
version = detect(root_dir).name
@@ -18,4 +15,4 @@ def main(argv):
if __name__ == "__main__":
main(sys.argv)
main()
Executable → Regular
-2
View File
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
from dataclasses import dataclass
from io import BytesIO
import json
Executable → Regular
-2
View File
@@ -1,5 +1,3 @@
#!/usr/bin/env node
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
Executable → Regular
View File
File mode changed.