diff --git a/python-Babel.changes b/python-Babel.changes index cf986ac..933c55d 100644 --- a/python-Babel.changes +++ b/python-Babel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 23 06:34:38 UTC 2025 - Bernhard Wiedemann + +- Add reproducible.patch to normalize date in .po (boo#1047218) + ------------------------------------------------------------------- Mon Feb 3 13:38:56 UTC 2025 - Dirk Müller diff --git a/python-Babel.spec b/python-Babel.spec index 6123dbf..aa7b6fc 100644 --- a/python-Babel.spec +++ b/python-Babel.spec @@ -32,6 +32,7 @@ Summary: Internationalization utilities License: BSD-3-Clause URL: https://babel.pocoo.org/ Source: https://files.pythonhosted.org/packages/source/b/babel/babel-%{version}.tar.gz +Patch0: reproducible.patch BuildRequires: %{python_module freezegun >= 1.0} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 6.0} @@ -73,6 +74,7 @@ A collection of tools for internationalizing Python applications. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +unset SOURCE_DATE_EPOCH %pytest %pre diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..9fc4445 --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,24 @@ +diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py +index f84a5bd..786d1a4 100644 +--- a/babel/messages/catalog.py ++++ b/babel/messages/catalog.py +@@ -11,6 +11,8 @@ from __future__ import annotations + + import datetime + import re ++import time ++import os + from collections.abc import Iterable, Iterator + from copy import copy + from difflib import SequenceMatcher +@@ -385,7 +387,9 @@ class Catalog: + self.charset = charset or 'utf-8' + + if creation_date is None: +- creation_date = datetime.datetime.now(LOCALTZ) ++ creation_date = datetime.datetime.utcfromtimestamp( ++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) ++ ) + elif isinstance(creation_date, datetime.datetime) and not creation_date.tzinfo: + creation_date = creation_date.replace(tzinfo=LOCALTZ) + self.creation_date = creation_date