From a8b6c49b9dcdd0af2a5f00333a7cba66d1ff11d3 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Tue, 29 Sep 2020 18:30:16 +0200 Subject: [PATCH] [PATCH] Enable implicitobsoleteusescolors flag. 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 | 1 + tests/hawkey/test_iutil.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp index f2f51be..54b3f25 100644 --- a/libdnf/dnf-sack.cpp +++ b/libdnf/dnf-sack.cpp @@ -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. diff --git a/tests/hawkey/test_iutil.cpp b/tests/hawkey/test_iutil.cpp index 62d0191..9d183b3 100644 --- a/tests/hawkey/test_iutil.cpp +++ b/tests/hawkey/test_iutil.cpp @@ -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; -- 2.30.2