aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/sort.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/sort.py b/contrib/sort.py
index 921343162..ad5e063ac 100755
--- a/contrib/sort.py
+++ b/contrib/sort.py
@@ -24,6 +24,7 @@ Exit-Codes:
24 24
25# Requirements: 25# Requirements:
26# python >= 3.6 26# python >= 3.6
27from os import getenv
27from sys import argv 28from sys import argv
28 29
29 30
@@ -80,7 +81,7 @@ def fix_profile(filename):
80 lines = profile.read().split("\n") 81 lines = profile.read().split("\n")
81 was_fixed = False 82 was_fixed = False
82 fixed_profile = [] 83 fixed_profile = []
83 for line in lines: 84 for lineno, line in enumerate(lines):
84 if line[:12] in ("private-bin ", "private-etc ", "private-lib "): 85 if line[:12] in ("private-bin ", "private-etc ", "private-lib "):
85 fixed_line = f"{line[:12]}{sort_alphabetical(line[12:])}" 86 fixed_line = f"{line[:12]}{sort_alphabetical(line[12:])}"
86 elif line[:13] in ("seccomp.drop ", "seccomp.keep "): 87 elif line[:13] in ("seccomp.drop ", "seccomp.keep "):
@@ -95,6 +96,8 @@ def fix_profile(filename):
95 fixed_line = line 96 fixed_line = line
96 if fixed_line != line: 97 if fixed_line != line:
97 was_fixed = True 98 was_fixed = True
99 if getenv("CI"):
100 print(f"{filename}:{lineno + 1}:{fixed_line}")
98 fixed_profile.append(fixed_line) 101 fixed_profile.append(fixed_line)
99 if was_fixed: 102 if was_fixed:
100 profile.seek(0) 103 profile.seek(0)