[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>
Sat, 29 Jun 2024 19:38:56 +0000 (20:38 +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 3c3a76578f09198c3f36624fb18f2946ffd85b40..4febbeb1874acf0295a3339979e35997fbfa33ea 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 38cab0d2882eaa68528b4e9d6d106abf69aca054..62d0191eb68dbaed9777ab57911b75bd2fde6d98 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;