[PATCH] Set the default disttype to RPM.
authorMihai Moldovan <ionic@ionic.de>
Tue, 29 Sep 2020 16:30:16 +0000 (18:30 +0200)
committerFrédéric Pierret <frederic.pierret@qubes-os.org>
Wed, 14 Apr 2021 19:26:57 +0000 (20:26 +0100)
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.

Gbp-Pq: Name 0003-Set-the-default-disttype-to-RPM.patch

libdnf/dnf-sack.cpp
tests/hawkey/test_iutil.cpp

index 6a43f01e3757f2d578d2f4882e748fcaa6e93e78..36f4a92bf29b5301dec58ac2fd34e90a29aed2e7 100644 (file)
@@ -186,6 +186,7 @@ dnf_sack_init(DnfSack *sack)
     DnfSackPrivate *priv = GET_PRIVATE(sack);
     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;
index 8d00cc94becbee188b6ed3e40789ceab8104cdf6..0ca12800719d45adc5a9552757404d68e4ee37c5 100644 (file)
@@ -150,6 +150,13 @@ END_TEST
 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;