diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-01-28 15:29:15 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-01-29 00:57:56 -0300 |
commit | d30e709b79ea774d4d24e6db712145e4c793066f (patch) | |
tree | de57987b0bbb1aa441a78cca71b71b7e22b993de | |
parent | build: make contrib target by default (diff) | |
download | firejail-d30e709b79ea774d4d24e6db712145e4c793066f.tar.gz firejail-d30e709b79ea774d4d24e6db712145e4c793066f.tar.zst firejail-d30e709b79ea774d4d24e6db712145e4c793066f.zip |
build: sort with C locale when generating syntax lists
To ensure a consistent order.
Misc: This might also make it a bit faster.
-rw-r--r-- | Makefile | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -95,32 +95,32 @@ syntax: $(SYNTAX_FILES) | |||
95 | # TODO: include/rlimit are false positives | 95 | # TODO: include/rlimit are false positives |
96 | contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c | 96 | contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c |
97 | @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \ | 97 | @sed -En 's/.*strn?cmp\(ptr, "([^ "]*[^ ])".*/\1/p' $< | \ |
98 | grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | sort -u >$@ | 98 | grep -Ev '^(include|rlimit)$$' | sed 's/\./\\./' | LC_ALL=C sort -u >$@ |
99 | 99 | ||
100 | # TODO: private-lib is special-cased in the code and doesn't match the regex | 100 | # TODO: private-lib is special-cased in the code and doesn't match the regex |
101 | contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c | 101 | contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c |
102 | @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \ | 102 | @{ sed -En 's/.*strn?cmp\(ptr, "([^"]+) ".*/\1/p' $<; echo private-lib; } | \ |
103 | sort -u >$@ | 103 | LC_ALL=C sort -u >$@ |
104 | 104 | ||
105 | contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c | 105 | contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c |
106 | @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \ | 106 | @awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$$/ {process=1;} \ |
107 | /\t*\{"[^"]+".*/ \ | 107 | /\t*\{"[^"]+".*/ \ |
108 | { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \ | 108 | { if (process) {print gensub(/^\t*\{"([^"]+)".*$$/, "\\1", 1);} } \ |
109 | /^\t\{ NULL, NULL \}$$/ {process=0;}' \ | 109 | /^\t\{ NULL, NULL \}$$/ {process=0;}' \ |
110 | $< | sort -u >$@ | 110 | $< | LC_ALL=C sort -u >$@ |
111 | 111 | ||
112 | contrib/syntax/lists/profile_macros.list: src/firejail/macros.c | 112 | contrib/syntax/lists/profile_macros.list: src/firejail/macros.c |
113 | @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | sort -u >$@ | 113 | @sed -En 's/.*\$$\{([^}]+)\}.*/\1/p' $< | LC_ALL=C sort -u >$@ |
114 | 114 | ||
115 | contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c | 115 | contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c |
116 | @sed -En 's/.*"@([^",]+).*/\1/p' $< | sort -u >$@ | 116 | @sed -En 's/.*"@([^",]+).*/\1/p' $< | LC_ALL=C sort -u >$@ |
117 | 117 | ||
118 | contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) | 118 | contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) |
119 | @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \ | 119 | @sed -n 's/{\s\+"\([^"]\+\)",.*},/\1/p' $(SYSCALL_HEADERS) | \ |
120 | sort -u >$@ | 120 | LC_ALL=C sort -u >$@ |
121 | 121 | ||
122 | contrib/syntax/lists/system_errnos.list: src/lib/errno.c | 122 | contrib/syntax/lists/system_errnos.list: src/lib/errno.c |
123 | @sed -En 's/.*"(E[^"]+).*/\1/p' $< | sort -u >$@ | 123 | @sed -En 's/.*"(E[^"]+).*/\1/p' $< | LC_ALL=C sort -u >$@ |
124 | 124 | ||
125 | pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } | 125 | pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } |
126 | space_fromlf = { tr '\n' ' ' | sed 's/ $$//'; } | 126 | space_fromlf = { tr '\n' ' ' | sed 's/ $$//'; } |