From edb62e2618022c42c011ebe0fdca1c40b17c096a132db99a0844ee22fc1906c4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 17 May 2021 12:35:59 +0000 Subject: [PATCH] Accepting request 893717 from home:alarrosa:branches:devel:languages:python - Add patch from upstream to fix build in i586 where a test fails due to the y2038 issue: * 0001-timestamp-rounding-tests-avoid-y2038-issue.patch OBS-URL: https://build.opensuse.org/request/show/893717 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfuse3?expand=0&rev=17 --- ...amp-rounding-tests-avoid-y2038-issue.patch | 33 +++++++++++++++++++ python-pyfuse3.changes | 7 ++++ python-pyfuse3.spec | 1 + 3 files changed, 41 insertions(+) create mode 100644 0001-timestamp-rounding-tests-avoid-y2038-issue.patch diff --git a/0001-timestamp-rounding-tests-avoid-y2038-issue.patch b/0001-timestamp-rounding-tests-avoid-y2038-issue.patch new file mode 100644 index 0000000..75681b8 --- /dev/null +++ b/0001-timestamp-rounding-tests-avoid-y2038-issue.patch @@ -0,0 +1,33 @@ +From fb94a809da286a950862910a9760468aee2654fd Mon Sep 17 00:00:00 2001 +From: Nikolaus Rath +Date: Sun, 31 Jan 2021 14:49:43 +0000 +Subject: [PATCH] timestamp rounding tests: avoid y2038 issue + +100y was beyond y2038 and could lead to issues on 32 bit +systems (cf. https://github.com/python-llfuse/python-llfuse/issues/60). +--- + test/test_rounding.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/test/test_rounding.py b/test/test_rounding.py +index 70865ed..58817a0 100755 +--- a/test/test_rounding.py ++++ b/test/test_rounding.py +@@ -22,12 +22,14 @@ def test_rounding(): + # all dates. + entry = pyfuse3.EntryAttributes() + +- # Approximately 100 years, ending in 999 +- secs = 100 * 365 * 24 * 3600 + 999 ++ # Approximately 67 years, ending in 999. ++ # Note: 67 years were chosen to avoid y2038 issues (1970 + 67 = 2037). ++ # Testing these is **not** in scope of this test. ++ secs = 67 * 365 * 24 * 3600 + 999 + nanos = _NANOS_PER_SEC - 1 + + total = secs * _NANOS_PER_SEC + nanos +- ++ + entry.st_atime_ns = total + entry.st_ctime_ns = total + entry.st_mtime_ns = total diff --git a/python-pyfuse3.changes b/python-pyfuse3.changes index 6fa96f4..8388fa1 100644 --- a/python-pyfuse3.changes +++ b/python-pyfuse3.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 17 11:22:24 UTC 2021 - Antonio Larrosa + +- Add patch from upstream to fix build in i586 where a test fails + due to the y2038 issue: + * 0001-timestamp-rounding-tests-avoid-y2038-issue.patch + ------------------------------------------------------------------- Sun May 16 08:03:01 UTC 2021 - ecsos diff --git a/python-pyfuse3.spec b/python-pyfuse3.spec index 89d56d4..4ea5d76 100644 --- a/python-pyfuse3.spec +++ b/python-pyfuse3.spec @@ -26,6 +26,7 @@ Summary: Python Bindings for the low-level FUSE3 API License: LGPL-2.1-or-later URL: https://github.com/libfuse/pyfuse3 Source: https://files.pythonhosted.org/packages/source/p/%{pname}/%{pname}-%{version}.tar.gz +Patch0: 0001-timestamp-rounding-tests-avoid-y2038-issue.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel >= 3.5} BuildRequires: %{python_module pytest >= 3.4.0}