diff --git a/0001-test-fix-discovery-of-location.patch b/0001-test-fix-discovery-of-location.patch new file mode 100644 index 0000000..af98636 --- /dev/null +++ b/0001-test-fix-discovery-of-location.patch @@ -0,0 +1,27 @@ +From d93e1563add8c40450556b7d74520439ee792bd9 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 12 Oct 2018 12:50:18 +0200 +Subject: [PATCH] test: fix discovery of location + +Use __file__ to detect the location of the script instead of sys.argv, +so it will work also when loaded as module. +--- + test/test_augeas.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test_augeas.py b/test/test_augeas.py +index 10edbe6..7474841 100644 +--- a/test/test_augeas.py ++++ b/test/test_augeas.py +@@ -4,7 +4,7 @@ import unittest + import sys + import os + +-__mydir = os.path.dirname(sys.argv[0]) ++__mydir = os.path.dirname(os.path.abspath(__file__)) + if not os.path.isdir(__mydir): + __mydir = os.getcwd() + +-- +2.21.0 + diff --git a/python-augeas.spec b/python-augeas.spec index 610f293..45f1318 100644 --- a/python-augeas.spec +++ b/python-augeas.spec @@ -1,10 +1,11 @@ Name: python-augeas Version: 0.5.0 -Release: 19%{?dist} +Release: 20%{?dist} Summary: Python bindings to augeas License: LGPLv2+ URL: http://augeas.net/ Source0: http://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz +Patch1: 0001-test-fix-discovery-of-location.patch BuildArch: noarch BuildRequires: python3-setuptools @@ -25,6 +26,7 @@ python3-augeas is a set of Python bindings around augeas. %prep %setup -q +%patch1 -p1 %build %{py3_build} @@ -41,6 +43,10 @@ python3-augeas is a set of Python bindings around augeas. %changelog +* Thu Apr 02 2020 Pino Toscano - 0.5.0-20 +- Backport upstream commit d93e1563add8c40450556b7d74520439ee792bd9 to fix + the discovery of location in the test + * Thu Jan 30 2020 Fedora Release Engineering - 0.5.0-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild