[PATCH] Enable implicitobsoleteusescolors flag.
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)
This flag is normally enabled by default in libsolv if compiled on Fedora or
Mageia systems, but disabled for all others. Since we explicitly want to
support Fedora (and CentOS/RHEL) repositories with DNF, enable this feature for
correct resolution.

Gbp-Pq: Name 0004-Enable-implicitobsoleteusescolors-flag.patch

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

index caef198a8f9740ba9948be06e5fcc8c1c8e4dfe9..e62ccff41979ea963cbb7fe241ad95ba8e82cf33 100644 (file)
@@ -186,6 +186,7 @@ dnf_sack_init(DnfSack *sack)
     priv->pool = pool_create();
     pool_set_flag(priv->pool, POOL_FLAG_WHATPROVIDESWITHDISABLED, 1);
     pool_setdisttype(priv->pool, DISTTYPE_RPM);
+    pool_set_flag(priv->pool, POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS, 1);
     priv->running_kernel_id = -1;
     priv->running_kernel_fn = running_kernel;
     priv->considered_uptodate = TRUE;
index 81048a4749abba98655694d18ada058e131c3fa4..4954f9cc49c348a96cda9699b4b6065f22d8c478 100644 (file)
@@ -169,6 +169,15 @@ START_TEST(test_version_split)
      */
     fail_if(-1 == pool_setdisttype(pool, DISTTYPE_RPM));
 
+    /*
+     * On "foreign" systems, the implicitobsoleteusescolors
+     * flag is turned off by default.
+     * This leads to unexpected results when working with
+     * Fedora, Mageia or CentOS repositories, so enable it
+     * forcefully.
+     */
+    pool_set_flag(pool, POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS, 1);
+
     char evr[] = "1:5.9.3-8";
     char *epoch, *version, *release;