aboutsummaryrefslogtreecommitdiffstats
path: root/community/osinfo-db-tools
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-06-01 22:23:49 -0300
committerKevin Daudt <kdaudt@alpinelinux.org>2019-06-02 06:40:26 +0000
commit6bf0bd7dc06650a2e9373caed7a8895d9808e054 (patch)
tree0eb9c950f354a2acb1aefd8458376737a985ccb2 /community/osinfo-db-tools
parent4633cdd709c616211b1f0f584c7e91a6a7984d46 (diff)
downloadaports-6bf0bd7dc06650a2e9373caed7a8895d9808e054.tar.bz2
aports-6bf0bd7dc06650a2e9373caed7a8895d9808e054.tar.xz
community/osinfo-db-tools: add patch to fix tests
Closes GH-8376
Diffstat (limited to 'community/osinfo-db-tools')
-rw-r--r--community/osinfo-db-tools/APKBUILD13
-rw-r--r--community/osinfo-db-tools/fix-tests.patch27
2 files changed, 32 insertions, 8 deletions
diff --git a/community/osinfo-db-tools/APKBUILD b/community/osinfo-db-tools/APKBUILD
index 5720d124b5..fada74ec2b 100644
--- a/community/osinfo-db-tools/APKBUILD
+++ b/community/osinfo-db-tools/APKBUILD
@@ -11,7 +11,9 @@ makedepends="intltool glib-dev libxml2-dev libarchive-dev libxslt-dev json-glib-
automake autoconf libtool"
checkdepends="py3-pytest py3-requests"
subpackages="$pkgname-doc $pkgname-lang"
-source="https://releases.pagure.org/libosinfo/osinfo-db-tools-$pkgver.tar.gz"
+source="https://releases.pagure.org/libosinfo/osinfo-db-tools-$pkgver.tar.gz
+ fix-tests.patch
+ "
prepare() {
default_prepare
@@ -30,12 +32,6 @@ build() {
}
check() {
- # One of the tests run a user instance of osinfo-db-tools which
- # installs configuration to the value of $XDG_CONFIG_HOME, defaulting
- # to $HOME/.config as per the XDG standard. But the value might be changed
- # by the user and the test only checks for $HOME/.config. So unset it here
- # so it doesn't have a chance to fail.
- unset XDG_CONFIG_HOME
make check
}
@@ -43,4 +39,5 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="baa42086ae13365e463064f0313228ec79d785a863b72c396d2a24d35496420d17ea09191629663c8c67ec46f3168f256ff50896053244cd0255be6ac08583d1 osinfo-db-tools-1.5.0.tar.gz"
+sha512sums="baa42086ae13365e463064f0313228ec79d785a863b72c396d2a24d35496420d17ea09191629663c8c67ec46f3168f256ff50896053244cd0255be6ac08583d1 osinfo-db-tools-1.5.0.tar.gz
+f1f4bd99a02f42b62e7f927f13a4ae5b5b3ff9e85add175bb753c064450cb52afb5eaa4cb4c709b6fdb203f6f00b87ffa8aadc19b3838cadcb6419c142a74dec fix-tests.patch"
diff --git a/community/osinfo-db-tools/fix-tests.patch b/community/osinfo-db-tools/fix-tests.patch
new file mode 100644
index 0000000000..a727e6e497
--- /dev/null
+++ b/community/osinfo-db-tools/fix-tests.patch
@@ -0,0 +1,27 @@
+Similarly to what's been done as part of 1df4c0dbede91, let's just unset
+XDG_CONFIG_HOME environment variable in our tests, in case those were
+externally set for some reason.
+
+https://gitlab.com/libosinfo/osinfo-db-tools/issues/3
+
+Signed-off-by: Fabiano FidĂȘncio <fidencio redhat com>
+---
+ tests/test_osinfo_db_path.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/test_osinfo_db_path.py b/tests/test_osinfo_db_path.py
+index d813c34..b0b6aff 100755
+--- a/tests/test_osinfo_db_path.py
++++ b/tests/test_osinfo_db_path.py
+@@ -44,6 +44,8 @@ def test_osinfo_db_path_user():
+ """
+ if "OSINFO_USER_DIR" in os.environ:
+ del os.environ["OSINFO_USER_DIR"]
++ if "XDG_CONFIG_HOME" in os.environ:
++ del os.environ["XDG_CONFIG_HOME"]
+ cmd = [util.Tools.db_path, util.ToolsArgs.USER]
+ output = util.get_output(cmd)
+ expected_output = os.path.join(os.environ["HOME"], ".config",
+--
+2.21.0
+