From 5056668ab27c1929982f9f6a78718705187c60f1 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Sat, 24 Jun 2023 11:56:05 +0100 Subject: [PATCH] Meta: Add lint check that ports have an executable package.sh --- Meta/lint-ports.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Meta/lint-ports.py b/Meta/lint-ports.py index 1222bc618d..1329601bc1 100755 --- a/Meta/lint-ports.py +++ b/Meta/lint-ports.py @@ -2,6 +2,7 @@ import os import re +import stat import sys import subprocess from pathlib import Path @@ -60,7 +61,7 @@ def read_port_table(filename): def read_port_dirs(): - """Check Ports directory for unexpected files and check each port has a package.sh file. + """Check Ports directory for unexpected files and check each port has an executable package.sh file. Returns: list: all ports (set), no errors encountered (bool) @@ -81,6 +82,9 @@ def read_port_dirs(): print(f"Ports/{entry}/ is missing its package.sh?!") all_good = False continue + if not os.stat(entry + '/package.sh')[stat.ST_MODE] & stat.S_IXUSR: + print(f"Ports/{entry}/package.sh is not executable?!") + all_good = False ports[entry] = get_port_properties(entry) return ports, all_good