[PATCH] Set the default disttype to RPM.
authorMihai Moldovan <ionic@ionic.de>
Tue, 29 Sep 2020 16:30:16 +0000 (18:30 +0200)
committerLuca Boccassi <bluca@debian.org>
Fri, 3 Nov 2023 19:22:17 +0000 (19:22 +0000)
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 d23c7d1598a4848b42027c8cf77b74656e52d11b..caef198a8f9740ba9948be06e5fcc8c1c8e4dfe9 100644 (file)
@@ -185,6 +185,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 f206a896734add22631379ed6fbc7dfea7d284d9..81048a4749abba98655694d18ada058e131c3fa4 100644 (file)
@@ -162,6 +162,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;