All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sepolicy/manpage.py: make output deterministic
@ 2023-10-25  9:49 Cathy Hu
  2023-10-25 10:35 ` Petr Lautrbach
  0 siblings, 1 reply; 5+ messages in thread
From: Cathy Hu @ 2023-10-25  9:49 UTC (permalink / raw)
  To: selinux; +Cc: selinux, 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.
---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index a488dcbf..62999019 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sepolicy/manpage.py: make output deterministic
  2023-10-25  9:49 [PATCH] sepolicy/manpage.py: make output deterministic Cathy Hu
@ 2023-10-25 10:35 ` Petr Lautrbach
  2023-10-25 13:18   ` [PATCH v2] " Cathy Hu
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Lautrbach @ 2023-10-25 10:35 UTC (permalink / raw)
  To: Cathy Hu, selinux; +Cc: selinux, Cathy Hu

Cathy Hu <cahu@suse.de> writes:

> 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


> ---
>  python/sepolicy/sepolicy/manpage.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
> index a488dcbf..62999019 100755
> --- a/python/sepolicy/sepolicy/manpage.py
> +++ b/python/sepolicy/sepolicy/manpage.py
> @@ -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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] sepolicy/manpage.py: make output deterministic
  2023-10-25 10:35 ` Petr Lautrbach
@ 2023-10-25 13:18   ` Cathy Hu
  2023-10-31 10:11     ` Petr Lautrbach
  0 siblings, 1 reply; 5+ messages in thread
From: Cathy Hu @ 2023-10-25 13:18 UTC (permalink / raw)
  To: selinux; +Cc: selinux, 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.

Signed-off-by: Cathy Hu <cahu@suse.de>
---
 python/sepolicy/sepolicy/manpage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index a488dcbf..62999019 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] sepolicy/manpage.py: make output deterministic
  2023-10-25 13:18   ` [PATCH v2] " Cathy Hu
@ 2023-10-31 10:11     ` Petr Lautrbach
  2023-11-07 21:39       ` James Carter
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Lautrbach @ 2023-10-31 10:11 UTC (permalink / raw)
  To: Cathy Hu, selinux; +Cc: selinux, Cathy Hu

Cathy Hu <cahu@suse.de> writes:

> 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.
>
> Signed-off-by: Cathy Hu <cahu@suse.de>

Acked-by: Petr Lautrbach <lautrbach@redhat.com>

> ---
>  python/sepolicy/sepolicy/manpage.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
> index a488dcbf..62999019 100755
> --- a/python/sepolicy/sepolicy/manpage.py
> +++ b/python/sepolicy/sepolicy/manpage.py
> @@ -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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] sepolicy/manpage.py: make output deterministic
  2023-10-31 10:11     ` Petr Lautrbach
@ 2023-11-07 21:39       ` James Carter
  0 siblings, 0 replies; 5+ messages in thread
From: James Carter @ 2023-11-07 21:39 UTC (permalink / raw)
  To: Petr Lautrbach; +Cc: Cathy Hu, selinux, selinux

On Tue, Oct 31, 2023 at 6:12 AM Petr Lautrbach <lautrbach@redhat.com> wrote:
>
> Cathy Hu <cahu@suse.de> writes:
>
> > 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.
> >
> > Signed-off-by: Cathy Hu <cahu@suse.de>
>
> Acked-by: Petr Lautrbach <lautrbach@redhat.com>
>

Merged.
Thanks,
Jim

> > ---
> >  python/sepolicy/sepolicy/manpage.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
> > index a488dcbf..62999019 100755
> > --- a/python/sepolicy/sepolicy/manpage.py
> > +++ b/python/sepolicy/sepolicy/manpage.py
> > @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-07 21:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-25  9:49 [PATCH] sepolicy/manpage.py: make output deterministic Cathy Hu
2023-10-25 10:35 ` Petr Lautrbach
2023-10-25 13:18   ` [PATCH v2] " Cathy Hu
2023-10-31 10:11     ` Petr Lautrbach
2023-11-07 21:39       ` James Carter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.