diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-03-03 07:43:14 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-03-03 10:10:39 -0300 |
commit | 908e5a1a437bb7907f78fac8cfecdfa92e26bad0 (patch) | |
tree | 98a64c43953f14b3ce8e88c4a5067d004b091444 /contrib | |
parent | RELNOTES: add feature and build items (diff) | |
download | firejail-908e5a1a437bb7907f78fac8cfecdfa92e26bad0.tar.gz firejail-908e5a1a437bb7907f78fac8cfecdfa92e26bad0.tar.zst firejail-908e5a1a437bb7907f78fac8cfecdfa92e26bad0.zip |
build: sort.py: filter empty and duplicate items
Note: This seems to already be done for `protocol` lines.
Before:
$ ./contrib/sort.py test.profile
sort.py: checking 1 profile(s)...
test.profile:1:-private-etc ,,bar,,foo,,bar,,,
test.profile:1:+private-etc ,,,,,,,bar,bar,foo
test.profile:2:-protocol ,,unix,,bluetooth,,unix,,inet,,,
test.profile:2:+protocol unix,inet,bluetooth
[ Fixed ] test.profile
After:
$ ./contrib/sort.py test.profile
sort.py: checking 1 profile(s)...
test.profile:1:-private-etc ,,bar,,foo,,bar,,,
test.profile:1:+private-etc bar,foo
test.profile:2:-protocol ,,unix,,bluetooth,,unix,,inet,,,
test.profile:2:+protocol unix,inet,bluetooth
[ Fixed ] test.profile
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/sort.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/sort.py b/contrib/sort.py index b70f83e6c..7a4f57da4 100755 --- a/contrib/sort.py +++ b/contrib/sort.py | |||
@@ -38,7 +38,8 @@ Exit Codes: | |||
38 | 38 | ||
39 | def sort_alphabetical(original_items): | 39 | def sort_alphabetical(original_items): |
40 | items = original_items.split(",") | 40 | items = original_items.split(",") |
41 | items.sort() | 41 | items = filter(None, set(items)) |
42 | items = sorted(items) | ||
42 | return ",".join(items) | 43 | return ",".join(items) |
43 | 44 | ||
44 | 45 | ||