diff --git a/0001-Fix-tests-with-python-3.4.patch b/0001-Fix-tests-with-python-3.4.patch new file mode 100644 index 0000000..6f88fb7 --- /dev/null +++ b/0001-Fix-tests-with-python-3.4.patch @@ -0,0 +1,36 @@ +From 52e8ed94d648ec8e3aae2534d34c84e5f65357ed Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Sun, 29 Sep 2024 10:59:57 +0200 +Subject: [PATCH 1/2] Fix tests with python 3.4 + +--- + test/test_rpmbuild.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/test_rpmbuild.py b/test/test_rpmbuild.py +index d64e40d2..8f2d45b7 100644 +--- a/test/test_rpmbuild.py ++++ b/test/test_rpmbuild.py +@@ -4,7 +4,6 @@ import re + import sys + import subprocess + import shutil +-import glob + + from textwrap import dedent + +@@ -101,8 +100,9 @@ class Package(object): + os.remove('tmperr') + # RPM 4.19 and 4.20 use different BUILD directory structure, thus we search the filesystem + # to find the actual location of build subdir without reliance on particular structure +- self.buildpath = glob.glob('rpmbuild/BUILD/**/{name}-subdir'.format(name=self.__name), +- recursive=True)[0] ++ self.buildpath = [os.path.join(dirpath, d) ++ for dirpath, dirnames, files in os.walk('rpmbuild/BUILD') ++ for d in dirnames if d.endswith('{name}-subdir'.format(name=self.__name))][0] + return (out, err, ret) + + def set_env(self, name, value): +-- +2.46.1 + diff --git a/0002-Partially-revert-the-rewrite-of-abs2rel-in-shell.patch b/0002-Partially-revert-the-rewrite-of-abs2rel-in-shell.patch new file mode 100644 index 0000000..84af250 --- /dev/null +++ b/0002-Partially-revert-the-rewrite-of-abs2rel-in-shell.patch @@ -0,0 +1,77 @@ +From 2eef7f3c0f46f28697fbafa71ce6f83d6e4af971 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Sun, 29 Sep 2024 11:14:25 +0200 +Subject: [PATCH 2/2] Partially revert the rewrite of abs2rel in shell + +--- + bin/abs2rel | 24 +++++++++++++++++------- + test/abs2rel_test.py | 6 +++--- + 2 files changed, 20 insertions(+), 10 deletions(-) + +diff --git a/bin/abs2rel b/bin/abs2rel +index b0b85048..1fdacb69 100755 +--- a/bin/abs2rel ++++ b/bin/abs2rel +@@ -1,5 +1,5 @@ +-#!/bin/sh +-# Copyright (c) 2024, Red Hat, Inc. ++#!@{pyinterpreter} ++# Copyright (c) 2017, Red Hat, Inc. + # + # All rights reserved. + # +@@ -31,9 +31,19 @@ + # + # Authors: Mikolaj Izdebski + +-if [ $# -ne 2 ]; then +- echo "Usage: $(basename $0) " >&2 +- exit 1 +-fi ++import os ++import sys + +-exec realpath -s --relative-to="$2" "$1" ++if len(sys.argv) != 3: ++ print("Usage: {0} " ++ .format(os.path.basename(sys.argv[0])), ++ file=sys.stderr) ++ sys.exit(1) ++ ++print(os.path.relpath(*sys.argv[1:])) ++ ++ ++# Local Variables: ++# mode: Python ++# End: ++# vi: ft=python +diff --git a/test/abs2rel_test.py b/test/abs2rel_test.py +index a55e97ea..73b0bb01 100644 +--- a/test/abs2rel_test.py ++++ b/test/abs2rel_test.py +@@ -4,19 +4,19 @@ from test_common import bindir_script + + class TestAbs2Rel(unittest.TestCase): + +- @bindir_script('abs2rel', ['dummy'], shell=True) ++ @bindir_script('abs2rel', ['dummy']) + def test_usage(self, stdout, stderr, return_value): + self.assertEqual(return_value, 1) + self.assertEqual('', stdout) + self.assertEqual('Usage: abs2rel \n', stderr) + +- @bindir_script('abs2rel', ['/1/2/3/a/b/c', '/1/2/3'], shell=True) ++ @bindir_script('abs2rel', ['/1/2/3/a/b/c', '/1/2/3']) + def test_abs_abs(self, stdout, stderr, return_value): + self.assertEqual(return_value, 0) + self.assertEqual('a/b/c\n', stdout) + self.assertEqual('', stderr) + +- @bindir_script('abs2rel', ['foo/bar', 'foo/baz'], shell=True) ++ @bindir_script('abs2rel', ['foo/bar', 'foo/baz']) + def test_rel_rel(self, stdout, stderr, return_value): + self.assertEqual(return_value, 0) + self.assertEqual('../bar\n', stdout) +-- +2.46.1 + diff --git a/javapackages-tools.spec b/javapackages-tools.spec index c7fe893..f372377 100644 --- a/javapackages-tools.spec +++ b/javapackages-tools.spec @@ -45,6 +45,9 @@ Patch1: python-optional.patch #PATCH-FIX-SUSE: SUSE did not bump epoch of openjdk packages, whereas Fedora did # Avoid generating unresolvable requires Patch2: suse-no-epoch.patch +Patch3: 0001-Fix-tests-with-python-3.4.patch +Patch4: 0002-Partially-revert-the-rewrite-of-abs2rel-in-shell.patch + BuildRequires: fdupes BuildRequires: perl BuildRequires: rpm