[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>
Mon, 26 Aug 2024 15:44:33 +0000 (16:44 +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 e95009fb2c9f977b888648d40c28b3f5ada44850..f2f51be232bacd84c5dffa5844c088487393c371 100644 (file)
@@ -186,6 +186,8 @@ dnf_sack_init(DnfSack *sack)
     priv->pool = pool_create();
     pool_set_flag(priv->pool, POOL_FLAG_WHATPROVIDESWITHDISABLED, 1);
 
+    pool_setdisttype(priv->pool, DISTTYPE_RPM);
+
     // Configures the pool_addfileprovides_queue() method to only add files from primary.xml.
     // This ensures the method works correctly even if filelist.xml metadata are not loaded.
     // At the same time when filelist.xml are loaded libsolv is able to search them for required
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;