Skip to contentSkip to conversation

sepolicy/manpage.py: make output deterministic

PATCH Superseded Cathy Hu 3 participants 5 messages Oct 25, 2023 – Nov 7, 2023 SELinux security module

lore
Share & tools
lore

Cathy Hu

author
#0 lore raw

PATCH 1/1 sepolicy/manpage.py: make output deterministic

The list entries in the alphabetically grouped dict are not sorted, which results in non-deterministic output for index.html.

Sort entries of those lists to make the output deterministic to be able to have reproducible builds.

See https://reproducible-builds.org/ for reasoning.
This patch was done while working on reproducible builds for openSUSE.

---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/sepolicy/sepolicy/manpage.py +1 -1
index a488dcbf..62999019 100755
@@ -156,7 +156,7 @@ def get_alphabet_manpages(manpage_list):
             if j.split("/")[-1][0] == i:
                 temp.append(j.split("/")[-1])
 
-        alphabet_manpages[i] = temp
+        alphabet_manpages[i] = sorted(temp)
 
     return alphabet_manpages
 
Signature · 1 line
2.42.0
#1 lore raw
Quoted 9 lines · Cathy Hu

The list entries in the alphabetically grouped dict are not sorted, which results in non-deterministic output for index.html.

Sort entries of those lists to make the output deterministic to be able to have reproducible builds.

See https://reproducible-builds.org/ for reasoning.
This patch was done while working on reproducible builds for openSUSE.

Looks good to me, thanks.

We just need you to provide Signed-off-by: tag, see
https://github.com/SELinuxProject/selinux/blob/main/CONTRIBUTING.md#contributing-code
and Developer Certificate of Origin

Quoted 19 lines
---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/sepolicy/sepolicy/manpage.py +1 -1
index a488dcbf..62999019 100755
@@ -156,7 +156,7 @@ def get_alphabet_manpages(manpage_list):
             if j.split("/")[-1][0] == i:
                 temp.append(j.split("/")[-1])
 
-        alphabet_manpages[i] = temp
+        alphabet_manpages[i] = sorted(temp)
 
     return alphabet_manpages
 
Signature · 1 line
2.42.0
author
#2 lore raw

PATCH v2 1/1 sepolicy/manpage.py: make output deterministic

The list entries in the alphabetically grouped dict are not sorted, which results in non-deterministic output for index.html.

Sort entries of those lists to make the output deterministic to be able to have reproducible builds.

See https://reproducible-builds.org/ for reasoning.
This patch was done while working on reproducible builds for openSUSE.

---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/sepolicy/sepolicy/manpage.py +1 -1
index a488dcbf..62999019 100755
@@ -156,7 +156,7 @@ def get_alphabet_manpages(manpage_list):
             if j.split("/")[-1][0] == i:
                 temp.append(j.split("/")[-1])
 
-        alphabet_manpages[i] = temp
+        alphabet_manpages[i] = sorted(temp)
 
     return alphabet_manpages
 
Signature · 1 line
2.42.0
Acked-by on v2 1/1
#3 lore raw
Quoted 11 lines · Cathy Hu

The list entries in the alphabetically grouped dict are not sorted, which results in non-deterministic output for index.html.

Sort entries of those lists to make the output deterministic to be able to have reproducible builds.

See https://reproducible-builds.org/ for reasoning.
This patch was done while working on reproducible builds for openSUSE.

Quoted 19 lines
---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/sepolicy/sepolicy/manpage.py +1 -1
index a488dcbf..62999019 100755
@@ -156,7 +156,7 @@ def get_alphabet_manpages(manpage_list):
             if j.split("/")[-1][0] == i:
                 temp.append(j.split("/")[-1])
 
-        alphabet_manpages[i] = temp
+        alphabet_manpages[i] = sorted(temp)
 
     return alphabet_manpages
 
Signature · 1 line
2.42.0
#4 lore raw
Quoted 10 lines · Petr Lautrbach
Quoted 7 lines · Cathy Hu

The list entries in the alphabetically grouped dict are not sorted, which results in non-deterministic output for index.html.

Sort entries of those lists to make the output deterministic to be able to have reproducible builds.

Quoted 7 lines
Quoted 4 lines

See https://reproducible-builds.org/ for reasoning.
This patch was done while working on reproducible builds for openSUSE.

Merged.
Thanks,
Jim

Quoted 20 lines
Quoted 19 lines
---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
python/sepolicy/sepolicy/manpage.py +1 -2
index a488dcbf..62999019 100755
@@ -156,7 +156,7 @@ def get_alphabet_manpages(manpage_list):
             if j.split("/")[-1][0] == i:
                 temp.append(j.split("/")[-1])
 
-        alphabet_manpages[i] = temp
+        alphabet_manpages[i] = sorted(temp)
 
     return alphabet_manpages
 
--

2.42.0