[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>
Mon, 26 Aug 2024 15:44:33 +0000 (16:44 +0100)
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 f2f51be232bacd84c5dffa5844c088487393c371..54b3f25f320dd266c9b74f81d6868e472037c786 100644 (file)
@@ -187,6 +187,7 @@ dnf_sack_init(DnfSack *sack)
     pool_set_flag(priv->pool, POOL_FLAG_WHATPROVIDESWITHDISABLED, 1);
 
     pool_setdisttype(priv->pool, DISTTYPE_RPM);
+    pool_set_flag(priv->pool, POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS, 1);
 
     // 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.
index 62d0191eb68dbaed9777ab57911b75bd2fde6d98..9d183b3a87443ccfdab70b01fde7cc595374ddcb 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;