Your message dated Wed, 16 Oct 2024 12:34:16 +0000
with message-id <e1t13eg-00dh5j...@fasolo.debian.org>
and subject line Bug#1085112: fixed in distro-info 1.12
has caused the Debian Bug report #1085112,
regarding python3-distro-info: filter by SOURCE_DATE_EPOCH when configured
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
1085112: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085112
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python3-distro-info
Version: 1.9
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
Control: affects -1 developers-reference
Dear Maintainer,
I'm an occasional volunteer contributor to the Reproducible Builds[1] project,
and recently noticed that the developers-reference package failed to build
deterministically on the test build infrastructure for Debian.
The difference in the build output appears in Debian release codenames
retrieved using the distro_info module in the python3-distro-info package.
In particular, varying system clock times during comparative builds can cause
the release codenames returned by distro-info to differ, due to date-based
filtering logic that uses datetime.date.today (system clock date) as a default
value.
Please find attached a patch to begin using the stable SOURCE_DATE_EPOCH[3]
build timestamp, when configured, as a source of the default date filter,
enabling repeatable and deterministic build output. (I'll also offer this as
a merge request on Salsa)
Regards,
James
[1] - https://reproducible-builds.org
[2] - https://sources.debian.org/src/distro-info/1.9/python/distro_info.py/#L129
[3] - https://reproducible-builds.org/docs/source-date-epoch/
>From 2807fa377f4192c2bc5d3e384e3e7ec4a9c018ea Mon Sep 17 00:00:00 2001
From: James Addison <j...@jp-hosting.net>
Date: Mon, 14 Oct 2024 21:10:32 +0100
Subject: [PATCH] python: add release filtering by SOURCE_DATE_EPOCH
---
python/distro_info.py | 6 +++++-
python/distro_info_test/test_distro_info.py | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/python/distro_info.py b/python/distro_info.py
index 34f1299..5822580 100644
--- a/python/distro_info.py
+++ b/python/distro_info.py
@@ -124,7 +124,11 @@ class DistroInfo:
_get_date(row, "eol-server"),
)
self._releases.append(release)
- self._date = datetime.date.today()
+ source_date_epoch = os.environ.get("SOURCE_DATE_EPOCH")
+ if source_date_epoch is not None:
+ self._date = datetime.date.fromtimestamp(int(source_date_epoch))
+ else:
+ self._date = datetime.date.today()
@property
def all(self) -> list[str]:
diff --git a/python/distro_info_test/test_distro_info.py
b/python/distro_info_test/test_distro_info.py
index b9e1cc1..d2d1fd1 100644
--- a/python/distro_info_test/test_distro_info.py
+++ b/python/distro_info_test/test_distro_info.py
@@ -18,6 +18,7 @@
import datetime
import unittest
+from unittest.mock import patch
from distro_info import DebianDistroInfo, UbuntuDistroInfo
@@ -91,6 +92,14 @@ class DebianDistroInfoTestCase(unittest.TestCase): #
pylint: disable=too-many-p
unsupported = ["buzz", "rex", "bo", "hamm", "slink", "potato",
"woody", "sarge", "etch"]
self.assertEqual(self._distro_info.unsupported(self._date),
unsupported)
+ @patch.dict("os.environ", {"SOURCE_DATE_EPOCH": "1500000000"})
+ def test_date_filtering(self) -> None:
+ """Test: filter supported Debian releases based on build date"""
+ supported = ['jessie', 'stretch', 'buster', 'sid', 'experimental']
+
+ distro_info = DebianDistroInfo()
+ self.assertEqual(distro_info.supported(), supported)
+
def test_codename(self) -> None:
"""Test: Codename decoding"""
self.assertIsNone(self._distro_info.codename("foobar"))
@@ -171,6 +180,14 @@ class UbuntuDistroInfoTestCase(unittest.TestCase): #
pylint: disable=too-many-p
unsupported = ["warty", "hoary", "breezy", "edgy", "feisty", "gutsy",
"intrepid", "jaunty"]
self.assertEqual(self._distro_info.unsupported(self._date),
unsupported)
+ @patch.dict("os.environ", {"SOURCE_DATE_EPOCH": "1500000000"})
+ def test_date_filtering(self) -> None:
+ """Test: filter supported Ubuntu releases based on build date"""
+ supported = ['trusty', 'xenial', 'yakkety', 'zesty', 'artful']
+
+ distro_info = UbuntuDistroInfo()
+ self.assertEqual(distro_info.supported(), supported)
+
def test_current_unsupported(self) -> None:
"""Test: List all unsupported Ubuntu distributions today."""
unsupported = {"warty", "hoary", "breezy", "edgy", "feisty", "gutsy",
"intrepid", "jaunty"}
--
2.45.2
--- End Message ---
--- Begin Message ---
Source: distro-info
Source-Version: 1.12
Done: Benjamin Drung <bdr...@debian.org>
We believe that the bug you reported is fixed in the latest version of
distro-info, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1085...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Benjamin Drung <bdr...@debian.org> (supplier of updated distro-info package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Wed, 16 Oct 2024 14:13:02 +0200
Source: distro-info
Built-For-Profiles: noudeb
Architecture: source
Version: 1.12
Distribution: unstable
Urgency: medium
Maintainer: Benjamin Drung <bdr...@debian.org>
Changed-By: Benjamin Drung <bdr...@debian.org>
Closes: 1085112
Changes:
distro-info (1.12) unstable; urgency=medium
.
[ James Addison ]
* python: add release filtering by SOURCE_DATE_EPOCH (Closes: #1085112)
Checksums-Sha1:
3fd7b50c96edcba160a88aeaafca668a79097946 2058 distro-info_1.12.dsc
b71e5b22b4f02811565d7e5302b278c35b71ba08 34268 distro-info_1.12.tar.xz
58c0a77ec78009024dfeab2f2a5cb96f21930b3d 8750 distro-info_1.12_source.buildinfo
Checksums-Sha256:
ab63891a73f4824ccf08a93ee2ce3e05a43ceb1c722b4e4c3562e6b1c8fa75a2 2058
distro-info_1.12.dsc
63f1183be7df8dbae19fd4ba388a2aff0d040bb4b4a96a80e9851e8a4c885c09 34268
distro-info_1.12.tar.xz
285e7a1e9a7f2497e05e8576e99460d3b3bf3d2c8b665a17393cc5a495cfddec 8750
distro-info_1.12_source.buildinfo
Files:
aac868d8b9d901d226a0c3c8de290dd3 2058 devel optional distro-info_1.12.dsc
2ef764bd44a609563ad2582be976c9e8 34268 devel optional distro-info_1.12.tar.xz
0b1f3601eea8f85396934055aea2bea2 8750 devel optional
distro-info_1.12_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEpi0s+9ULm1vzYNVLFZ61xO/Id0wFAmcPr9MACgkQFZ61xO/I
d0y45xAAmLBUk9pDa2afOsvO+ZximWi2ebebxR8Pk5iYs3eW5n+IBjtvCpBhkydb
1bsDeVn/sYlw9sD3jQOFv40GMtt621O6swYbwMGXs3SY55GrHNCDcckhf48t16do
CRtaY6bF8Mmhk00zxfKa94dwLT180SOW39NKAfkewuIIBiO+HTzEgAkY0Y6qNomg
AFtdg1JuMiAn2xP90Bud/mRrJEN9UkOJ1oQk99QQ2INXdvgJKw+1REh7W2xF6DSz
CUOq/tZBt21tH1FdOS65EOz3TU9Kx4SEgC5VV4YuM9FobzxkUAbMRP7za+MxFq/p
gI6ukp9b+l+C5pI1ScNB+O44ygedFuBKM9IexKTHlNEX9ViMxAoEVudhRPCCkmoh
+98D9AQDJP4Hvy55PPx4aKOLB5Y5T/i8M+JUrwXMpvfkOo/OiVjchmGOU0LPx3QD
/0AlLk2RwND5FIp3R45ZfZlXebOM4JrHAuA4xqieuQdESWwp4yGBiMU4VhZ8cACS
rGLfoyiH6/1T9DppQ/+FFhEn3apk7h3mnhPdUzvAUhHHFDSrk/jOq+VbsSbHjUQg
BmqKY3J37bLbK9XLnmk02no4/GG03hdQzphBvmR4gDj67CFsn6VzntFlxSjskm7z
tw71K5BcHyrPhQTPM0BGQLs/zuiAFXDLog3dcSFHhiVY5oSJPWM=
=bUke
-----END PGP SIGNATURE-----
pgpcA80Y72XqK.pgp
Description: PGP signature
--- End Message ---