From f4f5318ecb95a30e5b1db5be5f7d8a7a31220ac2 Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Wed, 17 Jul 2024 15:57:11 +0800 Subject: [PATCH 1/5] update to libdnf-0.63.0-19.src.rpm Signed-off-by: Zhao Hang --- ...nstalled_solvables-sort-RhBug2212838.patch | 37 ++ ...nstallonly-packages-marked-for-ERASE.patch | 99 ++++++ ...t-creation-SELinux-labels-on-GnuPG-d.patch | 335 ++++++++++++++++++ 1000-anolis-fix-platform-compatibility.patch | 20 -- 1001-arch-add-loongarch64-to-arch_map.patch | 24 -- 1002-libdnf-add-sw.patch | 25 -- 9999-change-bugtracker.diff | 23 ++ dist | 2 +- libdnf.spec | 258 +++++++------- 9 files changed, 628 insertions(+), 195 deletions(-) create mode 100644 0047-filterAdvisory-installed_solvables-sort-RhBug2212838.patch create mode 100644 0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch create mode 100644 0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch delete mode 100644 1000-anolis-fix-platform-compatibility.patch delete mode 100644 1001-arch-add-loongarch64-to-arch_map.patch delete mode 100644 1002-libdnf-add-sw.patch create mode 100644 9999-change-bugtracker.diff diff --git a/0047-filterAdvisory-installed_solvables-sort-RhBug2212838.patch b/0047-filterAdvisory-installed_solvables-sort-RhBug2212838.patch new file mode 100644 index 0000000..f4a3d4a --- /dev/null +++ b/0047-filterAdvisory-installed_solvables-sort-RhBug2212838.patch @@ -0,0 +1,37 @@ +From d138dbf60588b73a8ee9499540c82a8950ba9432 Mon Sep 17 00:00:00 2001 +From: Aleš Matěj +Date: Tue, 27 Jun 2023 07:24:28 +0200 +Subject: [PATCH] filterAdvisory: match installed_solvables sort with lower_bound (RhBug:2212838) + +`std::lower_bound` expects that the range it operates on is sorted by +the provided comparator. + +`lower_bound()` is used on `installed_solvables` twice, first with +comparator `NameSolvableComparator` and later with +`SolvableCompareAdvisoryPkgNameArch` to cover both we need to sort +`installed_solvables` by name and arch. + +Otherwise this can lead to problems if multiple architectures of a pkg +are installed. + +For: https://bugzilla.redhat.com/show_bug.cgi?id=2212838 +--- + libdnf/sack/query.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libdnf/sack/query.cpp b/libdnf/sack/query.cpp +index b7b1560..7937770 100644 +--- a/libdnf/sack/query.cpp ++++ b/libdnf/sack/query.cpp +@@ -1903,7 +1903,7 @@ Query::Impl::filterAdvisory(const Filter & f, Map *m, int keyname) + while ((installed_id = installed.pImpl->result->next(installed_id)) != -1) { + installed_solvables.push_back(pool_id2solvable(pool, installed_id)); + } +- std::sort(installed_solvables.begin(), installed_solvables.end(), NameSolvableComparator); ++ std::sort(installed_solvables.begin(), installed_solvables.end(), NameArchSolvableComparator); + + Query obsoletes(sack, ExcludeFlags::IGNORE_EXCLUDES); + obsoletes.addFilter(HY_PKG, HY_EQ, resultPset); +-- +libgit2 1.6.4 + diff --git a/0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch b/0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch new file mode 100644 index 0000000..520da71 --- /dev/null +++ b/0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch @@ -0,0 +1,99 @@ +From c32ce1071807176eb31d884d4185b20d944a28b9 Mon Sep 17 00:00:00 2001 +From: Aleš Matěj +Date: Mon, 25 Sep 2023 08:24:40 +0200 +Subject: [PATCH] Avoid reinstalling installonly packages marked for ERASE + +Without this patch reinstalling installonly pkg marked for ERASE might +be a valid smallest solution to our job. + +For example when user wants to install through a provide we select all +packages that provide it and put them inside a `job install oneof ...` +if one of the providers is also marked for ERASE due to installonly +limit libsolv might decide to reinstall it. + +To make sure it doesn't happen mark the available package also as ERASE. + +https://github.com/openSUSE/libsolv/issues/540 + +https://issues.redhat.com/browse/RHEL-1253 +(https://bugzilla.redhat.com/show_bug.cgi?id=2163474) +--- + libdnf/goal/Goal.cpp | 35 +++++++++++++++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 2 deletions(-) + +diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp +index b771030..6939d8a 100644 +--- a/libdnf/goal/Goal.cpp ++++ b/libdnf/goal/Goal.cpp +@@ -639,6 +639,12 @@ erase_flags2libsolv(int flags) + return ret; + } + ++static bool ++NameSolvableComparator(const Solvable * first, const Solvable * second) ++{ ++ return first->name < second->name; ++} ++ + Goal::Goal(const Goal & goal_src) : pImpl(new Impl(*goal_src.pImpl)) {} + + Goal::Impl::Impl(const Goal::Impl & goal_src) +@@ -1324,10 +1330,24 @@ Goal::Impl::limitInstallonlyPackages(Solver *solv, Queue *job) + for (int i = 0; i < onlies->count; ++i) { + Id p, pp; + IdQueue q, installing; ++ std::vector available_unused_providers; + ++ // Add all providers of installonly provides that are marked for install ++ // to `q` IdQueue those that are not marked for install and are not already ++ // installed are added to available_unused_providers. + FOR_PKG_PROVIDES(p, pp, onlies->elements[i]) +- if (solver_get_decisionlevel(solv, p) > 0) ++ // According to libsolv-bindings the decision level is positive for installs ++ // and negative for conflicts (conflicts with another package or dependency ++ // conflicts = dependencies cannot be met). ++ if (solver_get_decisionlevel(solv, p) > 0) { + q.pushBack(p); ++ } else { ++ Solvable *s = pool_id2solvable(pool, p); ++ if (s->repo != pool->installed) { ++ available_unused_providers.push_back(s); ++ } ++ } ++ + if (q.size() <= (int) dnf_sack_get_installonly_limit(sack)) { + continue; + } +@@ -1345,17 +1365,28 @@ Goal::Impl::limitInstallonlyPackages(Solver *solv, Queue *job) + + struct InstallonliesSortCallback s_cb = {pool, dnf_sack_running_kernel(sack)}; + solv_sort(q.data(), q.size(), sizeof(q[0]), sort_packages, &s_cb); ++ std::sort(available_unused_providers.begin(), available_unused_providers.end(), NameSolvableComparator); + IdQueue same_names; + while (q.size() > 0) { + same_name_subqueue(pool, q.getQueue(), same_names.getQueue()); + if (same_names.size() <= (int) dnf_sack_get_installonly_limit(sack)) + continue; + reresolve = 1; + for (int j = 0; j < same_names.size(); ++j) { + Id id = same_names[j]; + Id action = SOLVER_ERASE; +- if (j < (int) dnf_sack_get_installonly_limit(sack)) ++ if (j < (int) dnf_sack_get_installonly_limit(sack)) { + action = SOLVER_INSTALL; ++ } else { ++ // We want to avoid reinstalling packages marked for ERASE, therefore ++ // if some unused provider is also available we need to mark it ERASE as well. ++ Solvable *s = pool_id2solvable(pool, id); ++ auto low = std::lower_bound(available_unused_providers.begin(), available_unused_providers.end(), s, NameSolvableComparator); ++ while (low != available_unused_providers.end() && (*low)->name == s->name) { ++ queue_push2(job, SOLVER_ERASE | SOLVER_SOLVABLE, pool_solvable2id(pool, *low)); ++ ++low; ++ } ++ } + queue_push2(job, action | SOLVER_SOLVABLE, id); + } + } +-- +libgit2 1.6.4 + diff --git a/0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch b/0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch new file mode 100644 index 0000000..8c11b8b --- /dev/null +++ b/0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch @@ -0,0 +1,335 @@ +From 8752006f5f9c11bca3f04c99b463fd167caf0ddd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 4 Oct 2023 16:38:12 +0200 +Subject: [PATCH] PGP: Set a default creation SELinux labels on GnuPG + directories +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +libdnf used to precreate the directory in /run/user to make sure +a GnuPG agent executed by GPGME library places its socket there. + +The directories there are normally created and removed by systemd +(logind PAM session). libdnf created them for a case when a package +manager is invoked out of systemd session, before the super user logs +in. E.g. by a timer job to cache repository metadata. + +A problem was when this out-of-session process was a SELinux-confined +process creating files with its own SELinux label different from a DNF +program. Then the directory was created with a SELinux label different +from the one expected by systemd and when logging out a corresponding +user, the mismatching label clashed with systemd. + +The same issue was with temporary GnuPG home directories created by +libdnf under /tmp. + +This patch fixes both the isseus by restoring a SELinux label of those +directories to the label defined in a default SELinux file context +database. + +Obviously the database cannot have a record for a nonspecific +/tmp/tmpdir.XXXXXX (a mkdtemp() template) directory names. Therefore +I changed their names to more specific /tmp/libdnf.XXXXXX. Once +a SELinux policy updates the database, directories under /tmp will get +a correct label. + +There is yet another problem with accessing /var/cache/dnf/*/pubring, +but that seems to be pure SELinux policy problem. + +This patch adds a new -DENABLE_SELINUX=OFF CMake option to disable the +new dependency on libselinux. A default behavior is to support SELinux. + +Implementation details: + +I used selabel_lookup() + setfscreatecon() + mkdtemp() ++ setfscreatecon() sequence instead of mkdtemp() ++ selinux_restorecon() sequence because the later polutes stderr if +a SELinux policy does not define the default context. One could +supress stderr messages with selinux_set_callback(), but its effect +cannot be restored. + +I also kept the sequence in one function and reused it for creating +/run/user/$PID directories because the code is simpler than spliting +the function into three parts. + +https://issues.redhat.com/browse/RHEL-6421 +Signed-off-by: Petr Písař +--- + CMakeLists.txt | 7 +++ + libdnf.spec | 11 +++- + libdnf/CMakeLists.txt | 4 ++ + libdnf/repo/Repo.cpp | 121 +++++++++++++++++++++++++++++++++++++----- + 4 files changed, 129 insertions(+), 14 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d895b2bf..e5829e6a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,6 +34,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON) + option(WITH_ZCHUNK "Build with zchunk support" ON) + option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF) + option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF) ++option(ENABLE_SELINUX "Restore SELinux labels on GnuPG directories" ON) + + + # build options - debugging +@@ -83,6 +84,12 @@ if(ENABLE_RHSM_SUPPORT) + include_directories(${RHSM_INCLUDE_DIRS}) + endif() + ++if(ENABLE_SELINUX) ++ pkg_check_modules(SELINUX REQUIRED libselinux) ++ include_directories(${SELINUX_INCLUDE_DIRS}) ++ add_definitions(-DENABLE_SELINUX=1) ++endif() ++ + + # glibc: check if fnmatch.h has FNM_CASEFOLD symbol + include(CheckSymbolExists) +diff --git a/libdnf.spec b/libdnf.spec +index aa51dd28..df482f54 100644 +--- a/libdnf.spec ++++ b/libdnf.spec +@@ -42,6 +42,8 @@ + %bcond_with rhsm + %endif + ++%bcond_without selinux ++ + %if 0%{?rhel} + %bcond_with zchunk + %else +@@ -84,6 +86,9 @@ BuildRequires: pkgconfig(sqlite3) + BuildRequires: pkgconfig(json-c) + BuildRequires: pkgconfig(cppunit) + BuildRequires: pkgconfig(libcrypto) ++%if %{with selinux} ++BuildRequires: pkgconfig(libselinux) ++%endif + BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version} + BuildRequires: pkgconfig(smartcols) + BuildRequires: gettext +@@ -205,7 +210,8 @@ pushd build-py2 + %define __builddir build-py2 + %endif + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \ +- -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} ++ -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \ ++ -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} + %make_build + popd + %endif +@@ -219,7 +225,8 @@ pushd build-py3 + %define __builddir build-py3 + %endif + %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \ +- -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} ++ -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \ ++ -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} + %make_build + popd + %endif +diff --git a/libdnf/CMakeLists.txt b/libdnf/CMakeLists.txt +index 998a6f94..10b15230 100644 +--- a/libdnf/CMakeLists.txt ++++ b/libdnf/CMakeLists.txt +@@ -89,6 +89,10 @@ if(ENABLE_RHSM_SUPPORT) + target_link_libraries(libdnf ${RHSM_LIBRARIES}) + endif() + ++if(ENABLE_SELINUX) ++ target_link_libraries(libdnf ${SELINUX_LIBRARIES}) ++endif() ++ + set(DNF_SO_VERSION 2) + set_target_properties(libdnf PROPERTIES OUTPUT_NAME "dnf") + set_target_properties(libdnf PROPERTIES SOVERSION ${DNF_SO_VERSION}) +diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp +index d61a24a5..68b82ccc 100644 +--- a/libdnf/repo/Repo.cpp ++++ b/libdnf/repo/Repo.cpp +@@ -51,6 +51,11 @@ + + #include + ++#if ENABLE_SELINUX ++#include ++#include ++#endif ++ + #include + #include + #include +@@ -649,6 +654,78 @@ std::unique_ptr Repo::Impl::lrHandleInitRemote(const char *destdir) + return h; + } + ++/* ++ * @brief Create a temporary directory. ++ * ++ * Creates a temporary directory with 0700 mode attempting to set a proper ++ * SELinux file context. Encountered errors are logged at debug level to ++ * a global logger. ++ * ++ * @param name_template As an input value it is a template according to ++ * mkdtemp(3). As an output value it will contain the created directory name. ++ * ++ * @return 0 if the directory was created, -1 if it wasn't. SELinux failures ++ * are not considered an error. ++ */ ++static int create_temporary_directory(char *name_template) { ++ auto logger(Log::getLogger()); ++ int retval = 0; ++#if ENABLE_SELINUX ++ char *old_default_context = NULL; ++ char *new_default_context = NULL; ++ int old_default_context_was_retrieved= 0; ++ struct selabel_handle *labeling_handle = NULL; ++ ++ /* A purpose of this piece of code is to deal with applications whose ++ * security policy overrides a file context for temporary files but don't ++ * know that libdnf executes GnuPG which expects a default file context. */ ++ if (0 == getfscreatecon(&old_default_context)) { ++ old_default_context_was_retrieved = 1; ++ } else { ++ logger->debug(tfm::format("Failed to retrieve a default SELinux context")); ++ } ++ ++ labeling_handle = selabel_open(SELABEL_CTX_FILE, NULL, 0); ++ if (NULL == labeling_handle) { ++ logger->debug(tfm::format("Failed to open a SELinux labeling handle: %s", ++ strerror(errno))); ++ } else { ++ if (selabel_lookup(labeling_handle, &new_default_context, name_template, 0700)) { ++ /* Here we could hard-code "system_u:object_r:user_tmp_t:s0", but ++ * that value should be really defined in default file context ++ * SELinux policy. Only log that the policy is incpomplete. */ ++ logger->debug(tfm::format("Failed to look up a default SELinux label for \"%s\"", ++ name_template)); ++ } else { ++ if (setfscreatecon(new_default_context)) { ++ logger->debug(tfm::format("Failed to set default SELinux context to \"%s\"", ++ new_default_context)); ++ } ++ freecon(new_default_context); ++ } ++ selabel_close(labeling_handle); ++ } ++#endif ++ ++ /* mkdtemp() assures 0700 mode. */ ++ if (NULL == mkdtemp(name_template)) { ++ logger->debug(tfm::format("Failed to create a directory \"%s\": %s", ++ name_template, strerror(errno))); ++ retval = -1; ++ } ++ ++#if ENABLE_SELINUX ++ if (old_default_context_was_retrieved) { ++ if (setfscreatecon(old_default_context)) { ++ logger->debug(tfm::format("Failed to restore a default SELinux context")); ++ } ++ } ++ freecon(old_default_context); ++#endif ++ ++ return retval; ++} ++ + static void gpgImportKey(gpgme_ctx_t context, int keyFd) + { + auto logger(Log::getLogger()); +@@ -703,8 +780,8 @@ static std::vector rawkey2infos(int fd) { + std::unique_ptr::type> context(ctx); + + // set GPG home dir +- char tmpdir[] = "/tmp/tmpdir.XXXXXX"; +- mkdtemp(tmpdir); ++ char tmpdir[] = "/tmp/libdnf.XXXXXX"; ++ create_temporary_directory(tmpdir); + Finalizer tmpDirRemover([&tmpdir](){ + dnf_remove_recursive(tmpdir, NULL); + }); +@@ -853,6 +930,13 @@ std::vector Repo::Impl::retrieve(const std::string & url) + * would cause a race condition with calling gpgme_release(), see [2], [3], + * [4]. + * ++ * Current solution precreating /run/user/$UID showed problematic when this ++ * library was used out of a systemd-logind session from a programm with an ++ * unexpected SELinux context. Then /run/user/$UID, normally maintained by ++ * systemd, was assigned a SELinux label unexpected by systemd causing errors ++ * on a user logout [5]. We remedy it by restoring the label according to ++ * a file context policy. ++ * + * Since the agent doesn't clean up its sockets properly, by creating this + * directory we make sure they are in a place that is not causing trouble with + * container images. +@@ -861,14 +945,27 @@ std::vector Repo::Impl::retrieve(const std::string & url) + * [2] https://bugzilla.redhat.com/show_bug.cgi?id=1769831 + * [3] https://github.com/rpm-software-management/microdnf/issues/50 + * [4] https://bugzilla.redhat.com/show_bug.cgi?id=1781601 ++ * [5] https://issues.redhat.com/browse/RHEL-6421 + */ + static void ensure_socket_dir_exists() { + auto logger(Log::getLogger()); ++ char tmpdir[] = "/run/user/libdnf.XXXXXX"; + std::string dirname = "/run/user/" + std::to_string(getuid()); +- int res = mkdir(dirname.c_str(), 0700); +- if (res != 0 && errno != EEXIST) { +- logger->debug(tfm::format("Failed to create directory \"%s\": %d - %s", +- dirname, errno, strerror(errno))); ++ ++ /* create_temporary_directory() assures 0700 mode and tries its best to ++ * correct a SELinux label. */ ++ if (create_temporary_directory(tmpdir)) { ++ return; ++ } ++ ++ /* Set the desired name. */ ++ if (rename(tmpdir, dirname.c_str())) { ++ if (errno != EEXIST && errno != ENOTEMPTY && errno != EBUSY) { ++ logger->debug(tfm::format("Failed to rename \"%s\" directory to \"%s\": %s", ++ tmpdir, dirname, strerror(errno))); ++ } ++ rmdir(tmpdir); ++ return; + } + } + +@@ -1151,8 +1248,8 @@ void Repo::Impl::addCountmeFlag(LrHandle *handle) { + bool Repo::Impl::isMetalinkInSync() + { + auto logger(Log::getLogger()); +- char tmpdir[] = "/tmp/tmpdir.XXXXXX"; +- mkdtemp(tmpdir); ++ char tmpdir[] = "/tmp/libdnf.XXXXXX"; ++ create_temporary_directory(tmpdir); + Finalizer tmpDirRemover([&tmpdir](){ + dnf_remove_recursive(tmpdir, NULL); + }); +@@ -1221,8 +1318,8 @@ bool Repo::Impl::isRepomdInSync() + { + auto logger(Log::getLogger()); + LrYumRepo *yum_repo; +- char tmpdir[] = "/tmp/tmpdir.XXXXXX"; +- mkdtemp(tmpdir); ++ char tmpdir[] = "/tmp/libdnf.XXXXXX"; ++ create_temporary_directory(tmpdir); + Finalizer tmpDirRemover([&tmpdir](){ + dnf_remove_recursive(tmpdir, NULL); + }); +@@ -1260,8 +1357,8 @@ void Repo::Impl::fetch(const std::string & destdir, std::unique_ptr && + throw RepoError(tfm::format(_("Cannot create repo destination directory \"%s\": %s"), + destdir, errTxt)); + } +- auto tmpdir = destdir + "/tmpdir.XXXXXX"; +- if (!mkdtemp(&tmpdir.front())) { ++ auto tmpdir = destdir + "/libdnf.XXXXXX"; ++ if (create_temporary_directory(&tmpdir.front())) { + const char * errTxt = strerror(errno); + throw RepoError(tfm::format(_("Cannot create repo temporary directory \"%s\": %s"), + tmpdir.c_str(), errTxt)); +-- +2.41.0 + diff --git a/1000-anolis-fix-platform-compatibility.patch b/1000-anolis-fix-platform-compatibility.patch deleted file mode 100644 index b470693..0000000 --- a/1000-anolis-fix-platform-compatibility.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nur libdnf-0.55.0/libdnf/module/ModulePackage.cpp libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp ---- libdnf-0.55.0/libdnf/module/ModulePackage.cpp 2020-11-09 22:42:13.000000000 +0800 -+++ libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp 2021-07-08 16:40:15.635247194 +0800 -@@ -580,6 +580,16 @@ - Id id = repo_add_solvable(repo); - Solvable *solvable = pool_id2solvable(pool, id); - setSovable(pool, solvable, name, stream, version, context, "noarch"); -+ if (name == "platform" and stream == "an8") -+ { -+ std::string compatible_stream = "el8"; -+ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); -+ } -+ if (name == "platform" and stream == "el8") -+ { -+ std::string compatible_stream = "an8"; -+ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); -+ } - repoImpl->needs_internalizing = 1; - dnf_sack_set_provides_not_ready(moduleSack); - dnf_sack_set_considered_to_update(moduleSack); diff --git a/1001-arch-add-loongarch64-to-arch_map.patch b/1001-arch-add-loongarch64-to-arch_map.patch deleted file mode 100644 index be4e9b1..0000000 --- a/1001-arch-add-loongarch64-to-arch_map.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 9753114b8aaf03ef2bb30d02cf20275836f1d4ed Mon Sep 17 00:00:00 2001 -From: Liwei Ge -Date: Wed, 14 Sep 2022 15:09:32 +0800 -Subject: [PATCH] arch: add loongarch64 to arch_map - ---- - libdnf/dnf-context.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp -index d119e7d..4de4333 100644 ---- a/libdnf/dnf-context.cpp -+++ b/libdnf/dnf-context.cpp -@@ -115,6 +115,7 @@ static const struct { - { "sparc", { "sparc", "sparc64", "sparc64v", "sparcv8", - "sparcv9", "sparcv9v", NULL } }, - { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, -+ { "loongarch64",{ "loongarch64", NULL } }, - { NULL, { NULL } } - }; - --- -2.27.0 - diff --git a/1002-libdnf-add-sw.patch b/1002-libdnf-add-sw.patch deleted file mode 100644 index 683fc36..0000000 --- a/1002-libdnf-add-sw.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fc613dbf0418e13abb24c5f29ecef68e0c13ed71 Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 8 Aug 2023 10:58:35 +0800 -Subject: [PATCH] add sw - -Signed-off-by: rpm-build ---- - libdnf/dnf-context.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp -index e663949..750b97f 100644 ---- a/libdnf/dnf-context.cpp -+++ b/libdnf/dnf-context.cpp -@@ -119,6 +119,7 @@ static const struct { - "sparcv9", "sparcv9v", NULL } }, - { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, - { "loongarch64",{ "loongarch64", NULL } }, -+ { "sw_64", { "sw_64", NULL } }, - { NULL, { NULL } } - }; - --- -2.31.1 - diff --git a/9999-change-bugtracker.diff b/9999-change-bugtracker.diff new file mode 100644 index 0000000..526d2c5 --- /dev/null +++ b/9999-change-bugtracker.diff @@ -0,0 +1,23 @@ +diff -aruN libdnf-0.63.0/docs/hawkey/conf.py libdnf-0.63.0-new/docs/hawkey/conf.py +--- libdnf-0.63.0/docs/hawkey/conf.py 2021-05-18 17:07:23.000000000 -0700 ++++ libdnf-0.63.0-new/docs/hawkey/conf.py 2022-03-29 11:03:39.000000000 -0700 +@@ -260,6 +260,6 @@ + rst_prolog = """ + .. default-domain:: py + .. _libsolv: https://github.com/openSUSE/libsolv +-.. _bugzilla: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=hawkey ++.. _bugzilla: https://bugs.rockylinux.org/ + + """ +diff -aruN libdnf-0.63.0/libdnf/conf/Const.hpp libdnf-0.63.0-new/libdnf/conf/Const.hpp +--- libdnf-0.63.0/libdnf/conf/Const.hpp 2021-05-18 17:07:23.000000000 -0700 ++++ libdnf-0.63.0-new/libdnf/conf/Const.hpp 2022-03-29 11:03:47.000000000 -0700 +@@ -41,7 +41,7 @@ + "installonlypkg(vm)", + "multiversion(kernel)"}; + +-constexpr const char * BUGTRACKER="https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=dnf"; ++constexpr const char * BUGTRACKER="https://bugs.rockylinux.org/"; + + } + diff --git a/dist b/dist index 37a6f9c..9c0e36e 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8_9 +an8 diff --git a/libdnf.spec b/libdnf.spec index 7cf0b55..8dd99bc 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.2 %global libsolv_version 0.7.20-3 %global libmodulemd_version 2.11.2-2 %global librepo_version 1.13.1 @@ -37,12 +36,14 @@ %bcond_without python2 %endif -%if 0%{?rhel} && ! 0%{?centos} && ! 0%{?anolis} +%if 0%{?rhel} && ! 0%{?centos} %bcond_without rhsm %else %bcond_with rhsm %endif +%bcond_without selinux + %if 0%{?rhel} %bcond_with zchunk %else @@ -55,119 +56,122 @@ -DENABLE_RHSM_SUPPORT=%{?with_rhsm:ON}%{!?with_rhsm:OFF} \\\ %{nil} -Name: libdnf -Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 17%{anolis_release}%{?dist} -Summary: Library providing simplified C and Python API to libsolv -License: LGPLv2+ -URL: https://github.com/rpm-software-management/libdnf -Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -Patch1: 0001-Revert-Improve-performance-for-module-query.patch -Patch2: 0002-Revert-Enhance-description-of-modular-solvables.patch -Patch3: 0003-Revert-Fix-typo-lates-latest.patch -Patch4: 0004-Revert-Remove-unused-code-bump-version.patch -Patch5: 0005-Revert-Report-a-new-type-of-the-module-resolve-error.patch -Patch6: 0006-Revert-Add-additional-fallback-for-module-resolve.patch -Patch7: 0007-Revert-Decide-how-to-handle-context-according-to-sta.patch -Patch8: 0008-Revert-Fix-load-update-FailSafe.patch -Patch9: 0009-Revert-Change-mechanism-of-module-conflicts.patch -Patch10: 0010-Revert-Call-addVersion2Modules-as-late-as-possible.patch -Patch11: 0011-Revert-Fix-modular-queries-with-the-new-solver.patch -Patch12: 0012-Revert-Add-compatible-layer-for-MdDocuments-v2.patch -Patch13: 0013-Revert-Add-an-alternative-constructor-for-ModulePack.patch -Patch14: 0014-Revert-Adjust-modular-solver-to-new-context-type.patch -Patch15: 0015-Revert-Change-usage-of-context-and-version-in-modula.patch -Patch16: 0016-Fix-failing-unittest-caused-by-the-revert-of-new-mod.patch -Patch17: 0017-Modify-unit-test-after-change-of-handling-advisories.patch -Patch18: 0018-Adjust-module-error-formatting-function-for-original.patch -Patch19: 0019-Remove-redundant-test.patch -Patch20: 0020-Fix-dnf_context_module_install-memory-leaks.patch -Patch21: 0021-covscan-remove-unused-vars-mark-private-func-static-return-values.patch -Patch22: 0022-hawkey-surrogateescape-error-handler-to-decode-UTF-8-strings-RhBug1893176.patch -Patch23: 0023-Turn-off-strict-validation-of-modulemd-documents-RhBug200485320071662007167.patch -Patch24: 0024-Add-unittest-for-setting-up-repo-with-empty-keyfile-RhBug1994614.patch -Patch25: 0025-Add-getLatestModules.patch -Patch26: 0026-context-Substitute-all-repository-config-options-RhB.patch -Patch27: 0027-Use-environment-variable-in-unittest-instead-of-ugly.patch -Patch28: 0028-Add-private-API-for-filling-reading-and-verifying-ne.patch -Patch29: 0029-Use-dnf-solv-userdata-to-check-versions-and-checksum.patch -Patch30: 0030-Update-unittest-to-test-the-new-private-dnf-solvfile.patch -Patch31: 0031-Increase-required-libsolv-version-for-cache-versioni.patch -Patch32: 0032-Add-more-specific-error-handling-for-loading-repomd-.patch -Patch33: 0033-libdnf-transaction-RPMItem-Fix-handling-transaction-.patch -Patch34: 0034-libdnf-transaction-TransactionItem-Set-short-action-.patch -Patch35: 0035-Do-not-print-errors-on-failovermethod-repo-option-Rh.patch -Patch36: 0036-sack-query.hpp-Add-a-missing-include.patch -Patch37: 0037-context-dnf_context_remove-accepts-package-spec-as-d.patch -Patch38: 0038-context-Fix-doc-dnf_context_install-remove-update-di.patch -Patch39: 0039-advisory-upgrade-filter-out-advPkgs-with-different-a.patch -Patch40: 0040-Add-obsoletes-to-filtering-for-advisory-candidates.patch -Patch41: 0041-Fix-listing-a-repository-without-cpeid-RhBug-2066334.patch -Patch42: 0042-Allow-change-of-arch-during-security-updates-with-no.patch -Patch43: 0043-Update-translations.patch -Patch44: 0044-Add_repoid_to_solver_error_messagase.patch -Patch45: 0045-conf-Support-proxy-_none_-in-main-config-RhBug-21557.patch -Patch46: 0046-Update-translations-RHEL-8.9.patch - - -Patch1000: 1000-anolis-fix-platform-compatibility.patch -Patch1001: 1001-arch-add-loongarch64-to-arch_map.patch -Patch1002: 1002-libdnf-add-sw.patch - -BuildRequires: cmake -BuildRequires: gcc -BuildRequires: gcc-c++ -BuildRequires: libsolv-devel >= %{libsolv_version} -BuildRequires: pkgconfig(librepo) >= %{librepo_version} -BuildRequires: pkgconfig(check) +Name: libdnf +Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} +Release: 19%{?dist} +Summary: Library providing simplified C and Python API to libsolv +License: LGPLv2+ +URL: https://github.com/rpm-software-management/libdnf +Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +Patch1: 0001-Revert-Improve-performance-for-module-query.patch +Patch2: 0002-Revert-Enhance-description-of-modular-solvables.patch +Patch3: 0003-Revert-Fix-typo-lates-latest.patch +Patch4: 0004-Revert-Remove-unused-code-bump-version.patch +Patch5: 0005-Revert-Report-a-new-type-of-the-module-resolve-error.patch +Patch6: 0006-Revert-Add-additional-fallback-for-module-resolve.patch +Patch7: 0007-Revert-Decide-how-to-handle-context-according-to-sta.patch +Patch8: 0008-Revert-Fix-load-update-FailSafe.patch +Patch9: 0009-Revert-Change-mechanism-of-module-conflicts.patch +Patch10: 0010-Revert-Call-addVersion2Modules-as-late-as-possible.patch +Patch11: 0011-Revert-Fix-modular-queries-with-the-new-solver.patch +Patch12: 0012-Revert-Add-compatible-layer-for-MdDocuments-v2.patch +Patch13: 0013-Revert-Add-an-alternative-constructor-for-ModulePack.patch +Patch14: 0014-Revert-Adjust-modular-solver-to-new-context-type.patch +Patch15: 0015-Revert-Change-usage-of-context-and-version-in-modula.patch +Patch16: 0016-Fix-failing-unittest-caused-by-the-revert-of-new-mod.patch +Patch17: 0017-Modify-unit-test-after-change-of-handling-advisories.patch +Patch18: 0018-Adjust-module-error-formatting-function-for-original.patch +Patch19: 0019-Remove-redundant-test.patch +Patch20: 0020-Fix-dnf_context_module_install-memory-leaks.patch +Patch21: 0021-covscan-remove-unused-vars-mark-private-func-static-return-values.patch +Patch22: 0022-hawkey-surrogateescape-error-handler-to-decode-UTF-8-strings-RhBug1893176.patch +Patch23: 0023-Turn-off-strict-validation-of-modulemd-documents-RhBug200485320071662007167.patch +Patch24: 0024-Add-unittest-for-setting-up-repo-with-empty-keyfile-RhBug1994614.patch +Patch25: 0025-Add-getLatestModules.patch +Patch26: 0026-context-Substitute-all-repository-config-options-RhB.patch +Patch27: 0027-Use-environment-variable-in-unittest-instead-of-ugly.patch +Patch28: 0028-Add-private-API-for-filling-reading-and-verifying-ne.patch +Patch29: 0029-Use-dnf-solv-userdata-to-check-versions-and-checksum.patch +Patch30: 0030-Update-unittest-to-test-the-new-private-dnf-solvfile.patch +Patch31: 0031-Increase-required-libsolv-version-for-cache-versioni.patch +Patch32: 0032-Add-more-specific-error-handling-for-loading-repomd-.patch +Patch33: 0033-libdnf-transaction-RPMItem-Fix-handling-transaction-.patch +Patch34: 0034-libdnf-transaction-TransactionItem-Set-short-action-.patch +Patch35: 0035-Do-not-print-errors-on-failovermethod-repo-option-Rh.patch +Patch36: 0036-sack-query.hpp-Add-a-missing-include.patch +Patch37: 0037-context-dnf_context_remove-accepts-package-spec-as-d.patch +Patch38: 0038-context-Fix-doc-dnf_context_install-remove-update-di.patch +Patch39: 0039-advisory-upgrade-filter-out-advPkgs-with-different-a.patch +Patch40: 0040-Add-obsoletes-to-filtering-for-advisory-candidates.patch +Patch41: 0041-Fix-listing-a-repository-without-cpeid-RhBug-2066334.patch +Patch42: 0042-Allow-change-of-arch-during-security-updates-with-no.patch +Patch43: 0043-Update-translations.patch +Patch44: 0044-Add_repoid_to_solver_error_messagase.patch +Patch45: 0045-conf-Support-proxy-_none_-in-main-config-RhBug-21557.patch +Patch46: 0046-Update-translations-RHEL-8.9.patch +Patch47: 0047-filterAdvisory-installed_solvables-sort-RhBug2212838.patch +Patch48: 0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch +Patch49: 0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch +Patch50: 9999-change-bugtracker.diff + + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: libsolv-devel >= %{libsolv_version} +BuildRequires: pkgconfig(librepo) >= %{librepo_version} +BuildRequires: pkgconfig(check) %if %{with valgrind} -BuildRequires: valgrind +BuildRequires: valgrind %endif -BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 -BuildRequires: pkgconfig(gtk-doc) -BuildRequires: rpm-devel >= 4.11.0 +BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 +BuildRequires: pkgconfig(gtk-doc) +BuildRequires: rpm-devel >= 4.11.0 %if %{with rhsm} -BuildRequires: pkgconfig(librhsm) >= 0.0.3 +BuildRequires: pkgconfig(librhsm) >= 0.0.3 %endif %if %{with zchunk} -BuildRequires: pkgconfig(zck) >= 0.9.11 +BuildRequires: pkgconfig(zck) >= 0.9.11 +%endif +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(cppunit) +BuildRequires: pkgconfig(libcrypto) +%if %{with selinux} +BuildRequires: pkgconfig(libselinux) %endif -BuildRequires: pkgconfig(sqlite3) -BuildRequires: pkgconfig(json-c) -BuildRequires: pkgconfig(cppunit) -BuildRequires: pkgconfig(libcrypto) -BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version} -BuildRequires: pkgconfig(smartcols) -BuildRequires: gettext -BuildRequires: gpgme-devel +BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version} +BuildRequires: pkgconfig(smartcols) +BuildRequires: gettext +BuildRequires: gpgme-devel %if %{with sanitizers} -BuildRequires: libasan -BuildRequires: liblsan -BuildRequires: libubsan +BuildRequires: libasan +BuildRequires: liblsan +BuildRequires: libubsan %endif -Requires: libmodulemd%{?_isa} >= %{libmodulemd_version} -Requires: libsolv%{?_isa} >= %{libsolv_version} -Requires: librepo%{?_isa} >= %{librepo_version} +Requires: libmodulemd%{?_isa} >= %{libmodulemd_version} +Requires: libsolv%{?_isa} >= %{libsolv_version} +Requires: librepo%{?_isa} >= %{librepo_version} %if %{without python2} # Obsoleted from here so we can track the fast growing version easily. # We intentionally only obsolete and not provide, this is a broken upgrade # prevention, not providing the removed functionality. -Obsoletes: python2-%{name} < %{version}-%{release} -Obsoletes: python2-hawkey < %{version}-%{release} -Obsoletes: python2-hawkey-debuginfo < %{version}-%{release} -Obsoletes: python2-libdnf-debuginfo < %{version}-%{release} +Obsoletes: python2-%{name} < %{version}-%{release} +Obsoletes: python2-hawkey < %{version}-%{release} +Obsoletes: python2-hawkey-debuginfo < %{version}-%{release} +Obsoletes: python2-libdnf-debuginfo < %{version}-%{release} %endif %description A Library providing simplified C and Python API to libsolv. %package devel -Summary: Development files for %{name} -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: libsolv-devel%{?_isa} >= %{libsolv_version} +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: libsolv-devel%{?_isa} >= %{libsolv_version} %description devel Development files for %{name}. @@ -175,16 +179,16 @@ Development files for %{name}. %if %{with python2} %package -n python2-%{name} %{?python_provide:%python_provide python2-%{name}} -Summary: Python 2 bindings for the libdnf library. -Requires: %{name}%{?_isa} = %{version}-%{release} -BuildRequires: python2-devel +Summary: Python 2 bindings for the libdnf library. +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python2-devel %if !0%{?mageia} -BuildRequires: %{requires_python2_sphinx} +BuildRequires: %{requires_python2_sphinx} %endif %if 0%{?rhel} == 7 -BuildRequires: swig3 >= %{swig_version} +BuildRequires: swig3 >= %{swig_version} %else -BuildRequires: swig >= %{swig_version} +BuildRequires: swig >= %{swig_version} %endif %description -n python2-%{name} @@ -195,11 +199,11 @@ Python 2 bindings for the libdnf library. %if %{with python3} %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} -Summary: Python 3 bindings for the libdnf library. -Requires: %{name}%{?_isa} = %{version}-%{release} -BuildRequires: python3-devel -BuildRequires: %{requires_python3_sphinx} -BuildRequires: swig >= %{swig_version} +Summary: Python 3 bindings for the libdnf library. +Requires: %{name}%{?_isa} = %{version}-%{release} +BuildRequires: python3-devel +BuildRequires: %{requires_python3_sphinx} +BuildRequires: swig >= %{swig_version} %description -n python3-%{name} Python 3 bindings for the libdnf library. @@ -207,15 +211,15 @@ Python 3 bindings for the libdnf library. %if %{with python2} %package -n python2-hawkey -Summary: Python 2 bindings for the hawkey library +Summary: Python 2 bindings for the hawkey library %{?python_provide:%python_provide python2-hawkey} -BuildRequires: python2-devel -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python2-%{name} = %{version}-%{release} +BuildRequires: python2-devel +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python2-%{name} = %{version}-%{release} # Fix problem with hawkey - dnf version incompatibility # Can be deleted for distros where only python2-dnf >= 2.0.0 -Conflicts: python2-dnf < %{dnf_conflict} -Conflicts: python-dnf < %{dnf_conflict} +Conflicts: python2-dnf < %{dnf_conflict} +Conflicts: python-dnf < %{dnf_conflict} %description -n python2-hawkey Python 2 bindings for the hawkey library. @@ -224,16 +228,16 @@ Python 2 bindings for the hawkey library. %if %{with python3} %package -n python3-hawkey -Summary: Python 3 bindings for the hawkey library +Summary: Python 3 bindings for the hawkey library %{?python_provide:%python_provide python3-hawkey} -BuildRequires: python3-devel -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python3-%{name} = %{version}-%{release} +BuildRequires: python3-devel +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-%{name} = %{version}-%{release} # Fix problem with hawkey - dnf version incompatibility # Can be deleted for distros where only python3-dnf >= 2.0.0 -Conflicts: python3-dnf < %{dnf_conflict} +Conflicts: python3-dnf < %{dnf_conflict} # Obsoletes F27 packages -Obsoletes: platform-python-hawkey < %{version}-%{release} +Obsoletes: platform-python-hawkey < %{version}-%{release} %description -n python3-hawkey Python 3 bindings for the hawkey library. @@ -257,7 +261,8 @@ pushd build-py2 %define __builddir build-py2 %endif %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \ - -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} + -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \ + -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} %make_build popd %endif @@ -271,7 +276,8 @@ pushd build-py3 %define __builddir build-py3 %endif %cmake -DPYTHON_DESIRED:FILEPATH=%{__python3} -DWITH_GIR=0 -DWITH_MAN=0 -Dgtkdoc=0 ../ %{!?with_zchunk:-DWITH_ZCHUNK=OFF} %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} -DLIBDNF_MAJOR_VERSION=%{libdnf_major_version} -DLIBDNF_MINOR_VERSION=%{libdnf_minor_version} -DLIBDNF_MICRO_VERSION=%{libdnf_micro_version} \ - -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} + -DWITH_SANITIZERS=%{?with_sanitizers:ON}%{!?with_sanitizers:OFF} \ + -DENABLE_SELINUX=%{?with_selinux:ON}%{!?with_selinux:OFF} %make_build popd %endif @@ -357,13 +363,15 @@ popd %endif %changelog -* Wed Mar 20 2024 wxiat - 0.63.0-17.0.2 -- cherry-pick `add sw arch #9c8c414fae68cb1faed14be823ab34eb6ff00028`. +* Fri Dec 01 2023 Release Engineering - 0.63.0-19 +- Add Rocky bugtracker + +* Wed Oct 18 2023 Petr Pisar - 0.63.0-19 +- Set default SELinux labels on GnuPG directories (RHEL-6421) -* Tue Dec 05 2023 Liu Xiaoping - 0.63.0-17.0.1 -- Disable rhsm support in Anolis (geliwei@openanolis.org) -- rebrand: fix platform compatibility (geliwei@openanolis.org) -- Add loongarch64 to arch_map (liwei.glw@alibaba-inc.com) +* Fri Oct 13 2023 Jaroslav Rohel - 0.63.0-18 +- filterAdvisory: match installed_solvables sort with lower_bound (RhBug:2212838, RHEL-1244) +- Avoid reinstalling installonly packages marked for ERASE (RhBug:2163474, RHEL-1253) * Fri Sep 08 2023 Marek Blaha - 0.63.0-17 - Update translations -- Gitee From 524b324a34347db159858d17decff48764183d1c Mon Sep 17 00:00:00 2001 From: songmingliang Date: Tue, 17 May 2022 19:16:16 +0800 Subject: [PATCH 2/5] Disable rhsm support in Anolis --- libdnf.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libdnf.spec b/libdnf.spec index 8dd99bc..93bb427 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %global libsolv_version 0.7.20-3 %global libmodulemd_version 2.11.2-2 %global librepo_version 1.13.1 @@ -36,7 +37,7 @@ %bcond_without python2 %endif -%if 0%{?rhel} && ! 0%{?centos} +%if 0%{?rhel} && ! 0%{?centos} && ! 0%{?anolis} %bcond_without rhsm %else %bcond_with rhsm @@ -58,7 +59,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 19%{?dist} +Release: 19%{anolis_release}%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -363,6 +364,9 @@ popd %endif %changelog +* Wed Jul 17 2024 Liu Xiaoping - 0.63.0-19.0.1 +- Disable rhsm support in Anolis (geliwei@openanolis.org) + * Fri Dec 01 2023 Release Engineering - 0.63.0-19 - Add Rocky bugtracker -- Gitee From 789401dc05b57de8d56b77cc4ac72533b2078d76 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Wed, 18 May 2022 14:02:51 +0800 Subject: [PATCH 3/5] module: fix platform compatibility with centos --- 1000-anolis-fix-platform-compatibility.patch | 20 ++++++++++++++++++++ libdnf.spec | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 1000-anolis-fix-platform-compatibility.patch diff --git a/1000-anolis-fix-platform-compatibility.patch b/1000-anolis-fix-platform-compatibility.patch new file mode 100644 index 0000000..b470693 --- /dev/null +++ b/1000-anolis-fix-platform-compatibility.patch @@ -0,0 +1,20 @@ +diff -Nur libdnf-0.55.0/libdnf/module/ModulePackage.cpp libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp +--- libdnf-0.55.0/libdnf/module/ModulePackage.cpp 2020-11-09 22:42:13.000000000 +0800 ++++ libdnf-0.55.0.new/libdnf/module/ModulePackage.cpp 2021-07-08 16:40:15.635247194 +0800 +@@ -580,6 +580,16 @@ + Id id = repo_add_solvable(repo); + Solvable *solvable = pool_id2solvable(pool, id); + setSovable(pool, solvable, name, stream, version, context, "noarch"); ++ if (name == "platform" and stream == "an8") ++ { ++ std::string compatible_stream = "el8"; ++ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); ++ } ++ if (name == "platform" and stream == "el8") ++ { ++ std::string compatible_stream = "an8"; ++ setSovable(pool, solvable, name, compatible_stream, version, context, "noarch"); ++ } + repoImpl->needs_internalizing = 1; + dnf_sack_set_provides_not_ready(moduleSack); + dnf_sack_set_considered_to_update(moduleSack); diff --git a/libdnf.spec b/libdnf.spec index 93bb427..e9815d7 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -114,6 +114,7 @@ Patch47: 0047-filterAdvisory-installed_solvables-sort-RhBug2212838. Patch48: 0048-Avoid-reinstal-installonly-packages-marked-for-ERASE.patch Patch49: 0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch Patch50: 9999-change-bugtracker.diff +Patch1000: 1000-anolis-fix-platform-compatibility.patch BuildRequires: cmake @@ -366,6 +367,7 @@ popd %changelog * Wed Jul 17 2024 Liu Xiaoping - 0.63.0-19.0.1 - Disable rhsm support in Anolis (geliwei@openanolis.org) +- rebrand: fix platform compatibility (geliwei@openanolis.org) * Fri Dec 01 2023 Release Engineering - 0.63.0-19 - Add Rocky bugtracker -- Gitee From 638a71dd6f2c835a895b322a13065657198e7cd0 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Wed, 14 Sep 2022 15:15:37 +0800 Subject: [PATCH 4/5] arch: add loongarch64 to arch_map Signed-off-by: Liwei Ge --- 1001-arch-add-loongarch64-to-arch_map.patch | 24 +++++++++++++++++++++ libdnf.spec | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 1001-arch-add-loongarch64-to-arch_map.patch diff --git a/1001-arch-add-loongarch64-to-arch_map.patch b/1001-arch-add-loongarch64-to-arch_map.patch new file mode 100644 index 0000000..be4e9b1 --- /dev/null +++ b/1001-arch-add-loongarch64-to-arch_map.patch @@ -0,0 +1,24 @@ +From 9753114b8aaf03ef2bb30d02cf20275836f1d4ed Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Wed, 14 Sep 2022 15:09:32 +0800 +Subject: [PATCH] arch: add loongarch64 to arch_map + +--- + libdnf/dnf-context.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp +index d119e7d..4de4333 100644 +--- a/libdnf/dnf-context.cpp ++++ b/libdnf/dnf-context.cpp +@@ -115,6 +115,7 @@ static const struct { + { "sparc", { "sparc", "sparc64", "sparc64v", "sparcv8", + "sparcv9", "sparcv9v", NULL } }, + { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, ++ { "loongarch64",{ "loongarch64", NULL } }, + { NULL, { NULL } } + }; + +-- +2.27.0 + diff --git a/libdnf.spec b/libdnf.spec index e9815d7..4751fb7 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -115,7 +115,7 @@ Patch48: 0048-Avoid-reinstal-installonly-packages-marked-for-ERASE. Patch49: 0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d.patch Patch50: 9999-change-bugtracker.diff Patch1000: 1000-anolis-fix-platform-compatibility.patch - +Patch1001: 1001-arch-add-loongarch64-to-arch_map.patch BuildRequires: cmake BuildRequires: gcc @@ -368,6 +368,7 @@ popd * Wed Jul 17 2024 Liu Xiaoping - 0.63.0-19.0.1 - Disable rhsm support in Anolis (geliwei@openanolis.org) - rebrand: fix platform compatibility (geliwei@openanolis.org) +- Add loongarch64 to arch_map (liwei.glw@alibaba-inc.com) * Fri Dec 01 2023 Release Engineering - 0.63.0-19 - Add Rocky bugtracker -- Gitee From 0a7484e9d4af9388a01cdf07b90f3a6f3c4ada72 Mon Sep 17 00:00:00 2001 From: wxiat Date: Tue, 8 Aug 2023 11:04:01 +0800 Subject: [PATCH 5/5] cherry-pick `add sw arch #9c8c414fae68cb1faed14be823ab34eb6ff00028`. Signed-off-by: wxiat Signed-off-by: Weisson --- 1002-libdnf-add-sw.patch | 25 +++++++++++++++++++++++++ libdnf.spec | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 1002-libdnf-add-sw.patch diff --git a/1002-libdnf-add-sw.patch b/1002-libdnf-add-sw.patch new file mode 100644 index 0000000..683fc36 --- /dev/null +++ b/1002-libdnf-add-sw.patch @@ -0,0 +1,25 @@ +From fc613dbf0418e13abb24c5f29ecef68e0c13ed71 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 8 Aug 2023 10:58:35 +0800 +Subject: [PATCH] add sw + +Signed-off-by: rpm-build +--- + libdnf/dnf-context.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp +index e663949..750b97f 100644 +--- a/libdnf/dnf-context.cpp ++++ b/libdnf/dnf-context.cpp +@@ -119,6 +119,7 @@ static const struct { + "sparcv9", "sparcv9v", NULL } }, + { "x86_64", { "x86_64", "amd64", "ia32e", NULL } }, + { "loongarch64",{ "loongarch64", NULL } }, ++ { "sw_64", { "sw_64", NULL } }, + { NULL, { NULL } } + }; + +-- +2.31.1 + diff --git a/libdnf.spec b/libdnf.spec index 4751fb7..452f571 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -116,6 +116,7 @@ Patch49: 0049-PGP-Set-a-default-creation-SELinux-labels-on-GnuPG-d. Patch50: 9999-change-bugtracker.diff Patch1000: 1000-anolis-fix-platform-compatibility.patch Patch1001: 1001-arch-add-loongarch64-to-arch_map.patch +Patch1002: 1002-libdnf-add-sw.patch BuildRequires: cmake BuildRequires: gcc @@ -369,6 +370,7 @@ popd - Disable rhsm support in Anolis (geliwei@openanolis.org) - rebrand: fix platform compatibility (geliwei@openanolis.org) - Add loongarch64 to arch_map (liwei.glw@alibaba-inc.com) +- cherry-pick `add sw arch #9c8c414fae68cb1faed14be823ab34eb6ff00028`. (nijie@wxiat.com) * Fri Dec 01 2023 Release Engineering - 0.63.0-19 - Add Rocky bugtracker -- Gitee