* [PATCH] python/sepolicy: allow to override manpage date
@ 2020-10-30 21:53 Bernhard M. Wiedemann
2020-11-13 12:15 ` Petr Lautrbach
0 siblings, 1 reply; 2+ messages in thread
From: Bernhard M. Wiedemann @ 2020-10-30 21:53 UTC (permalink / raw)
To: selinux; +Cc: Bernhard M. Wiedemann
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
This patch was done while working on reproducible builds for openSUSE.
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
---
python/sepolicy/sepolicy/manpage.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
index 3e8a3be9..2f847abb 100755
--- a/python/sepolicy/sepolicy/manpage.py
+++ b/python/sepolicy/sepolicy/manpage.py
@@ -39,6 +39,8 @@ typealias_types = {
equiv_dict = {"smbd": ["samba"], "httpd": ["apache"], "virtd": ["virt", "libvirt"], "named": ["bind"], "fsdaemon": ["smartmon"], "mdadm": ["raid"]}
equiv_dirs = ["/var"]
+man_date = time.strftime("%y-%m-%d", time.gmtime(
+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
modules_dict = None
@@ -569,7 +571,7 @@ class ManPage:
def _typealias(self,typealias):
self.fd.write('.TH "%(typealias)s_selinux" "8" "%(date)s" "%(typealias)s" "SELinux Policy %(typealias)s"'
- % {'typealias':typealias, 'date': time.strftime("%y-%m-%d")})
+ % {'typealias':typealias, 'date': man_date})
self.fd.write(r"""
.SH "NAME"
%(typealias)s_selinux \- Security Enhanced Linux Policy for the %(typealias)s processes
@@ -588,7 +590,7 @@ man page for more details.
def _header(self):
self.fd.write('.TH "%(domainname)s_selinux" "8" "%(date)s" "%(domainname)s" "SELinux Policy %(domainname)s"'
- % {'domainname': self.domainname, 'date': time.strftime("%y-%m-%d")})
+ % {'domainname': self.domainname, 'date': man_date})
self.fd.write(r"""
.SH "NAME"
%(domainname)s_selinux \- Security Enhanced Linux Policy for the %(domainname)s processes
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] python/sepolicy: allow to override manpage date
2020-10-30 21:53 [PATCH] python/sepolicy: allow to override manpage date Bernhard M. Wiedemann
@ 2020-11-13 12:15 ` Petr Lautrbach
0 siblings, 0 replies; 2+ messages in thread
From: Petr Lautrbach @ 2020-11-13 12:15 UTC (permalink / raw)
To: selinux; +Cc: Bernhard M. Wiedemann
"Bernhard M. Wiedemann" <bwiedemann@suse.de> writes:
> in order to make builds reproducible.
> See https://reproducible-builds.org/ for why this is good
> and https://reproducible-builds.org/specs/source-date-epoch/
> for the definition of this variable.
>
> This patch was done while working on reproducible builds for openSUSE.
>
> Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Acked-by: Petr Lautrbach <plautrba@redhat.com>
And merged. Thank you!
> ---
> python/sepolicy/sepolicy/manpage.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
> index 3e8a3be9..2f847abb 100755
> --- a/python/sepolicy/sepolicy/manpage.py
> +++ b/python/sepolicy/sepolicy/manpage.py
> @@ -39,6 +39,8 @@ typealias_types = {
> equiv_dict = {"smbd": ["samba"], "httpd": ["apache"], "virtd": ["virt", "libvirt"], "named": ["bind"], "fsdaemon": ["smartmon"], "mdadm": ["raid"]}
>
> equiv_dirs = ["/var"]
> +man_date = time.strftime("%y-%m-%d", time.gmtime(
> + int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
> modules_dict = None
>
>
> @@ -569,7 +571,7 @@ class ManPage:
>
> def _typealias(self,typealias):
> self.fd.write('.TH "%(typealias)s_selinux" "8" "%(date)s" "%(typealias)s" "SELinux Policy %(typealias)s"'
> - % {'typealias':typealias, 'date': time.strftime("%y-%m-%d")})
> + % {'typealias':typealias, 'date': man_date})
> self.fd.write(r"""
> .SH "NAME"
> %(typealias)s_selinux \- Security Enhanced Linux Policy for the %(typealias)s processes
> @@ -588,7 +590,7 @@ man page for more details.
>
> def _header(self):
> self.fd.write('.TH "%(domainname)s_selinux" "8" "%(date)s" "%(domainname)s" "SELinux Policy %(domainname)s"'
> - % {'domainname': self.domainname, 'date': time.strftime("%y-%m-%d")})
> + % {'domainname': self.domainname, 'date': man_date})
> self.fd.write(r"""
> .SH "NAME"
> %(domainname)s_selinux \- Security Enhanced Linux Policy for the %(domainname)s processes
> --
> 2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-13 12:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 21:53 [PATCH] python/sepolicy: allow to override manpage date Bernhard M. Wiedemann
2020-11-13 12:15 ` Petr Lautrbach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox