1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From 7339ac2f41639afbfb4c1627e8883629fdb0f097 Mon Sep 17 00:00:00 2001
From: Mihai Moldovan <ionic@ionic.de>
Date: Tue, 29 Sep 2020 18:30:16 +0200
Subject: [PATCH] Set the default disttype to RPM.
On "foreign" systems, including Debian, libsolv tries to be smart and default
to the native packaging system type. We need to explicitly override it to use
RPM for dnf to work.
---
libdnf/dnf-sack.cpp | 1 +
tests/hawkey/test_iutil.cpp | 7 +++++++
2 files changed, 8 insertions(+)
--- a/libdnf/dnf-sack.cpp
+++ b/libdnf/dnf-sack.cpp
@@ -186,6 +186,8 @@
priv->pool = pool_create();
pool_set_flag(priv->pool, POOL_FLAG_WHATPROVIDESWITHDISABLED, 1);
+ pool_setdisttype(priv->pool, DISTTYPE_RPM);
+
priv->running_kernel_id = -1;
priv->running_kernel_fn = running_kernel;
priv->considered_uptodate = TRUE;
--- a/tests/hawkey/test_iutil.cpp
+++ b/tests/hawkey/test_iutil.cpp
@@ -162,6 +162,13 @@
START_TEST(test_version_split)
{
Pool *pool = pool_create();
+
+ /*
+ * On "foreign" systems, the disttype will
+ * not default to RPM. Set this explicitly.
+ */
+ fail_if(-1 == pool_setdisttype(pool, DISTTYPE_RPM));
+
char evr[] = "1:5.9.3-8";
char *epoch, *version, *release;
|