aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-28 15:29:15 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-29 00:57:56 -0300
commitd30e709b79ea774d4d24e6db712145e4c793066f (patch)
treede57987b0bbb1aa441a78cca71b71b7e22b993de
parentbuild: make contrib target by default (diff)
downloadfirejail-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--Makefile14
1 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index cbe59349c..443c3183f 100644
--- a/Makefile
+++ b/Makefile
@@ -95,32 +95,32 @@ syntax: $(SYNTAX_FILES)
95# TODO: include/rlimit are false positives 95# TODO: include/rlimit are false positives
96contrib/syntax/lists/profile_commands_arg0.list: src/firejail/profile.c 96contrib/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
101contrib/syntax/lists/profile_commands_arg1.list: src/firejail/profile.c 101contrib/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
105contrib/syntax/lists/profile_conditionals.list: src/firejail/profile.c 105contrib/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
112contrib/syntax/lists/profile_macros.list: src/firejail/macros.c 112contrib/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
115contrib/syntax/lists/syscall_groups.list: src/lib/syscall.c 115contrib/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
118contrib/syntax/lists/syscalls.list: $(SYSCALL_HEADERS) 118contrib/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
122contrib/syntax/lists/system_errnos.list: src/lib/errno.c 122contrib/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
125pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; } 125pipe_fromlf = { tr '\n' '|' | sed 's/|$$//'; }
126space_fromlf = { tr '\n' ' ' | sed 's/ $$//'; } 126space_fromlf = { tr '\n' ' ' | sed 's/ $$//'; }