Merge branch 'c9' into a9
This commit is contained in:
commit
71e7fcc407
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
SOURCES/libdnf-0.65.0.tar.gz
|
SOURCES/libdnf-0.67.0.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
95bd8ed682ca9c1b20913afba767c5e91fa3da13 SOURCES/libdnf-0.65.0.tar.gz
|
2abb8e24d867da4433345678764163e703b7729f SOURCES/libdnf-0.67.0.tar.gz
|
||||||
|
@ -1,383 +0,0 @@
|
|||||||
From 5fbecb9533a5584d20a2b76f5816e58c2ffbb6f6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
|
||||||
Date: Wed, 2 Feb 2022 08:45:36 +0100
|
|
||||||
Subject: [PATCH 1/2] Use `rpmdbCookie` from librpm, remove
|
|
||||||
`hawkey.Sack._rpmdb_version`
|
|
||||||
|
|
||||||
`dnf_sack_get_rpmdb_version` function that computed the hash of installed
|
|
||||||
packages was removed. `rpmdbCookie` function from librpm is used in context
|
|
||||||
part of libdnf instead.
|
|
||||||
|
|
||||||
The private Python function `hawkey.Sack._rpmdb_version()` was removed too.
|
|
||||||
It was used by DNF. The new version of DNF uses
|
|
||||||
`rpm.TransactionSet.dbCookie()` function from librpm, which wraps
|
|
||||||
the `rpmdbCookie` function. So the same librpm function will be used
|
|
||||||
in context part of libdnf (e.g. by microdnf) and in the DNF.
|
|
||||||
|
|
||||||
`rpmdbCookie` funkcion is safer. It also detect reinstalation of package
|
|
||||||
as a change. That will be needed in the future to determining if the libsolv
|
|
||||||
cache is still valid.
|
|
||||||
It also solves the libdnf problem with SHA1 in FIPS mode.
|
|
||||||
|
|
||||||
= changelog =
|
|
||||||
msg: Use `rpmdbCookie` from librpm, remove `hawkey.Sack._rpmdb_version`
|
|
||||||
type: bugfix
|
|
||||||
related: https://bugzilla.redhat.com/show_bug.cgi?id=2043476
|
|
||||||
---
|
|
||||||
libdnf/dnf-sack-private.hpp | 15 ------------
|
|
||||||
libdnf/dnf-sack.cpp | 40 -------------------------------
|
|
||||||
libdnf/dnf-transaction.cpp | 48 +++++++++++++++++++++----------------
|
|
||||||
python/hawkey/sack-py.cpp | 8 -------
|
|
||||||
4 files changed, 27 insertions(+), 84 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libdnf/dnf-sack-private.hpp b/libdnf/dnf-sack-private.hpp
|
|
||||||
index 89873534..2db96320 100644
|
|
||||||
--- a/libdnf/dnf-sack-private.hpp
|
|
||||||
+++ b/libdnf/dnf-sack-private.hpp
|
|
||||||
@@ -81,19 +81,4 @@ std::pair<std::vector<std::vector<std::string>>, libdnf::ModulePackageContainer:
|
|
||||||
|
|
||||||
std::vector<libdnf::ModulePackage *> requiresModuleEnablement(DnfSack * sack, const libdnf::PackageSet * installSet);
|
|
||||||
|
|
||||||
-/**
|
|
||||||
- * @brief Return fingerprint of installed RPMs.
|
|
||||||
- * The format is <count>:<hash>.
|
|
||||||
- * <count> is a count of installed RPMs.
|
|
||||||
- * <hash> is a sha1 hash of sorted sha1hdr hashes of installed RPMs.
|
|
||||||
- *
|
|
||||||
- * The count can be computed from the command line by running:
|
|
||||||
- * rpm -qa --qf='%{name}\n' | grep -v '^gpg-pubkey$' | wc -l
|
|
||||||
- *
|
|
||||||
- * The hash can be computed from the command line by running:
|
|
||||||
- * rpm -qa --qf='%{name} %{sha1header}\n' | grep -v '^gpg-pubkey ' \
|
|
||||||
- * | cut -d ' ' -f 2 | LC_ALL=C sort | tr -d '\n' | sha1sum
|
|
||||||
- */
|
|
||||||
-std::string dnf_sack_get_rpmdb_version(DnfSack *sack);
|
|
||||||
-
|
|
||||||
#endif // HY_SACK_INTERNAL_H
|
|
||||||
diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp
|
|
||||||
index a88e8a1c..13977730 100644
|
|
||||||
--- a/libdnf/dnf-sack.cpp
|
|
||||||
+++ b/libdnf/dnf-sack.cpp
|
|
||||||
@@ -80,7 +80,6 @@ extern "C" {
|
|
||||||
#include "module/ModulePackage.hpp"
|
|
||||||
#include "repo/Repo-private.hpp"
|
|
||||||
#include "repo/solvable/DependencyContainer.hpp"
|
|
||||||
-#include "utils/crypto/sha1.hpp"
|
|
||||||
#include "utils/File.hpp"
|
|
||||||
#include "utils/utils.hpp"
|
|
||||||
#include "log.hpp"
|
|
||||||
@@ -2535,42 +2534,3 @@ std::pair<std::vector<std::vector<std::string>>, libdnf::ModulePackageContainer:
|
|
||||||
setModuleExcludes(sack, hotfixRepos, *moduleContainer);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
-std::string dnf_sack_get_rpmdb_version(DnfSack *sack) {
|
|
||||||
- // collect all sha1hdr checksums
|
|
||||||
- // they are sufficiently unique IDs that represent installed RPMs
|
|
||||||
- std::vector<std::string> checksums;
|
|
||||||
-
|
|
||||||
- // iterate all @System repo RPMs (rpmdb records)
|
|
||||||
- libdnf::Query query{sack, libdnf::Query::ExcludeFlags::IGNORE_EXCLUDES};
|
|
||||||
- query.installed();
|
|
||||||
-
|
|
||||||
- auto pset = query.getResultPset();
|
|
||||||
- Id id = -1;
|
|
||||||
- while(true) {
|
|
||||||
- id = pset->next(id);
|
|
||||||
- if (id == -1) {
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- DnfPackage *pkg = dnf_package_new(sack, id);
|
|
||||||
- // store pkgid (equals to sha1hdr)
|
|
||||||
- checksums.push_back(libdnf::string::fromCstring(dnf_package_get_pkgid(pkg)));
|
|
||||||
- g_object_unref(pkg);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // sort checksums to compute the output checksum always the same
|
|
||||||
- std::sort(checksums.begin(), checksums.end());
|
|
||||||
-
|
|
||||||
- SHA1Hash h;
|
|
||||||
- for (auto & checksum : checksums) {
|
|
||||||
- h.update(checksum.c_str());
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // build <count>:<hash> output
|
|
||||||
- std::ostringstream result;
|
|
||||||
- result << checksums.size();
|
|
||||||
- result << ":";
|
|
||||||
- result << h.hexdigest();
|
|
||||||
-
|
|
||||||
- return result.str();
|
|
||||||
-}
|
|
||||||
diff --git a/libdnf/dnf-transaction.cpp b/libdnf/dnf-transaction.cpp
|
|
||||||
index e0966582..d93c5ec6 100644
|
|
||||||
--- a/libdnf/dnf-transaction.cpp
|
|
||||||
+++ b/libdnf/dnf-transaction.cpp
|
|
||||||
@@ -28,6 +28,7 @@
|
|
||||||
* This object represents an RPM transaction.
|
|
||||||
*/
|
|
||||||
|
|
||||||
+#include <rpm/rpmdb.h>
|
|
||||||
#include <rpm/rpmlib.h>
|
|
||||||
#include <rpm/rpmlog.h>
|
|
||||||
#include <rpm/rpmts.h>
|
|
||||||
@@ -53,6 +54,7 @@
|
|
||||||
#include "transaction/Swdb.hpp"
|
|
||||||
#include "transaction/Transformer.hpp"
|
|
||||||
#include "utils/bgettext/bgettext-lib.h"
|
|
||||||
+#include "utils/utils.hpp"
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
DNF_TRANSACTION_STEP_STARTED,
|
|
||||||
@@ -1136,9 +1138,8 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
|
|
||||||
libdnf::Swdb *swdb = priv->swdb;
|
|
||||||
PluginHookContextTransactionData data{PLUGIN_HOOK_ID_CONTEXT_PRE_TRANSACTION, transaction, goal, state};
|
|
||||||
DnfSack * sack = hy_goal_get_sack(goal);
|
|
||||||
- DnfSack * rpmdb_version_sack = NULL;
|
|
||||||
- std::string rpmdb_begin;
|
|
||||||
- std::string rpmdb_end;
|
|
||||||
+ std::unique_ptr<char, decltype(free)*> rpmdb_cookie_uptr{nullptr, free};
|
|
||||||
+ std::string rpmdb_cookie;
|
|
||||||
|
|
||||||
/* take lock */
|
|
||||||
ret = dnf_state_take_lock(state, DNF_LOCK_TYPE_RPMDB, DNF_LOCK_MODE_PROCESS, error);
|
|
||||||
@@ -1431,17 +1432,24 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
|
|
||||||
if (!dnf_context_plugin_hook(priv->context, PLUGIN_HOOK_ID_CONTEXT_PRE_TRANSACTION, &data, nullptr))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- // FIXME get commandline
|
|
||||||
- if (sack) {
|
|
||||||
- rpmdb_begin = dnf_sack_get_rpmdb_version(sack);
|
|
||||||
- } else {
|
|
||||||
- // if sack is not available, create a custom instance
|
|
||||||
- rpmdb_version_sack = dnf_sack_new();
|
|
||||||
- dnf_sack_load_system_repo(rpmdb_version_sack, nullptr, DNF_SACK_LOAD_FLAG_NONE, nullptr);
|
|
||||||
- rpmdb_begin = dnf_sack_get_rpmdb_version(rpmdb_version_sack);
|
|
||||||
- g_object_unref(rpmdb_version_sack);
|
|
||||||
+ // Open rpm database if it is not already open
|
|
||||||
+ if (!rpmtsGetRdb(priv->ts)) {
|
|
||||||
+ rc = rpmtsOpenDB(priv->ts, rpmtsGetDBMode(priv->ts));
|
|
||||||
+ if (rc != 0) {
|
|
||||||
+ ret = FALSE;
|
|
||||||
+ g_set_error(
|
|
||||||
+ error, DNF_ERROR, DNF_ERROR_INTERNAL_ERROR, _("Error %i opening rpm database"), rc);
|
|
||||||
+ goto out;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- swdb->beginTransaction(_get_current_time(), rpmdb_begin, "", priv->uid);
|
|
||||||
+
|
|
||||||
+ rpmdb_cookie_uptr.reset(rpmdbCookie(rpmtsGetRdb(priv->ts)));
|
|
||||||
+ rpmdb_cookie = libdnf::string::fromCstring(rpmdb_cookie_uptr.get());
|
|
||||||
+ if (rpmdb_cookie.empty()) {
|
|
||||||
+ g_critical(_("The rpmdbCookie() function did not return cookie of rpm database."));
|
|
||||||
+ }
|
|
||||||
+ // FIXME get commandline
|
|
||||||
+ swdb->beginTransaction(_get_current_time(), rpmdb_cookie, "", priv->uid);
|
|
||||||
|
|
||||||
/* run the transaction */
|
|
||||||
priv->state = dnf_state_get_child(state);
|
|
||||||
@@ -1481,14 +1489,12 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
|
|
||||||
if (!ret)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- // finalize swdb transaction
|
|
||||||
- // always load a new sack with rpmdb state after the transaction
|
|
||||||
- rpmdb_version_sack = dnf_sack_new();
|
|
||||||
- dnf_sack_load_system_repo(rpmdb_version_sack, nullptr, DNF_SACK_LOAD_FLAG_NONE, nullptr);
|
|
||||||
- rpmdb_end = dnf_sack_get_rpmdb_version(rpmdb_version_sack);
|
|
||||||
- g_object_unref(rpmdb_version_sack);
|
|
||||||
-
|
|
||||||
- swdb->endTransaction(_get_current_time(), rpmdb_end.c_str(), libdnf::TransactionState::DONE);
|
|
||||||
+ rpmdb_cookie_uptr.reset(rpmdbCookie(rpmtsGetRdb(priv->ts)));
|
|
||||||
+ rpmdb_cookie = libdnf::string::fromCstring(rpmdb_cookie_uptr.get());
|
|
||||||
+ if (rpmdb_cookie.empty()) {
|
|
||||||
+ g_critical(_("The rpmdbCookie() function did not return cookie of rpm database."));
|
|
||||||
+ }
|
|
||||||
+ swdb->endTransaction(_get_current_time(), rpmdb_cookie, libdnf::TransactionState::DONE);
|
|
||||||
swdb->closeTransaction();
|
|
||||||
|
|
||||||
data.hookId = PLUGIN_HOOK_ID_CONTEXT_TRANSACTION;
|
|
||||||
diff --git a/python/hawkey/sack-py.cpp b/python/hawkey/sack-py.cpp
|
|
||||||
index 4de499cb..fcb5cd61 100644
|
|
||||||
--- a/python/hawkey/sack-py.cpp
|
|
||||||
+++ b/python/hawkey/sack-py.cpp
|
|
||||||
@@ -783,13 +783,6 @@ load_repo(_SackObject *self, PyObject *args, PyObject *kwds) try
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
} CATCH_TO_PYTHON
|
|
||||||
|
|
||||||
-static PyObject *
|
|
||||||
-rpmdb_version(_SackObject *self, PyObject *unused) try
|
|
||||||
-{
|
|
||||||
- auto result = dnf_sack_get_rpmdb_version(self->sack);
|
|
||||||
- return PyString_FromString(result.c_str());
|
|
||||||
-} CATCH_TO_PYTHON
|
|
||||||
-
|
|
||||||
static Py_ssize_t
|
|
||||||
len(_SackObject *self) try
|
|
||||||
{
|
|
||||||
@@ -858,7 +851,6 @@ PyMethodDef sack_methods[] = {
|
|
||||||
METH_VARARGS | METH_KEYWORDS, NULL},
|
|
||||||
{"load_repo", (PyCFunction)load_repo, METH_VARARGS | METH_KEYWORDS,
|
|
||||||
NULL},
|
|
||||||
- {"_rpmdb_version", (PyCFunction)rpmdb_version, METH_VARARGS | METH_KEYWORDS, NULL},
|
|
||||||
{NULL} /* sentinel */
|
|
||||||
};
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
|
|
||||||
From 3dae1fd8754ec9521e16e2e11a7c4bf2c81bbb02 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Rohel <jrohel@redhat.com>
|
|
||||||
Date: Wed, 2 Feb 2022 18:00:39 +0100
|
|
||||||
Subject: [PATCH 2/2] Remove class `SHA1Hash`, which is no longer used, remove
|
|
||||||
OpenSSL require
|
|
||||||
|
|
||||||
The class was used by the `dnf_sack_get_rpmdb_version` function, which was
|
|
||||||
removed. The `rpmdbCookie` function from librpm is used instead.
|
|
||||||
---
|
|
||||||
CMakeLists.txt | 1 -
|
|
||||||
libdnf.spec | 1 -
|
|
||||||
libdnf/CMakeLists.txt | 1 -
|
|
||||||
libdnf/utils/CMakeLists.txt | 1 -
|
|
||||||
libdnf/utils/crypto/CMakeLists.txt | 5 -----
|
|
||||||
libdnf/utils/crypto/sha1.cpp | 36 ------------------------------
|
|
||||||
libdnf/utils/crypto/sha1.hpp | 25 ---------------------
|
|
||||||
7 files changed, 70 deletions(-)
|
|
||||||
delete mode 100644 libdnf/utils/crypto/CMakeLists.txt
|
|
||||||
delete mode 100644 libdnf/utils/crypto/sha1.cpp
|
|
||||||
delete mode 100644 libdnf/utils/crypto/sha1.hpp
|
|
||||||
|
|
||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
||||||
index 60cf1b8c..7149b9e6 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -52,7 +52,6 @@ endif()
|
|
||||||
# build dependencies
|
|
||||||
find_package(Gpgme REQUIRED)
|
|
||||||
find_package(LibSolv 0.6.30 REQUIRED COMPONENTS ext)
|
|
||||||
-find_package(OpenSSL REQUIRED)
|
|
||||||
|
|
||||||
|
|
||||||
# build dependencies via pkg-config
|
|
||||||
diff --git a/libdnf.spec b/libdnf.spec
|
|
||||||
index 697911f0..89d2fb40 100644
|
|
||||||
--- a/libdnf.spec
|
|
||||||
+++ b/libdnf.spec
|
|
||||||
@@ -83,7 +83,6 @@ BuildRequires: pkgconfig(zck) >= 0.9.11
|
|
||||||
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
|
|
||||||
diff --git a/libdnf/CMakeLists.txt b/libdnf/CMakeLists.txt
|
|
||||||
index 998a6f94..9e71d139 100644
|
|
||||||
--- a/libdnf/CMakeLists.txt
|
|
||||||
+++ b/libdnf/CMakeLists.txt
|
|
||||||
@@ -75,7 +75,6 @@ target_link_libraries(libdnf
|
|
||||||
${GLIB_GIO_UNIX_LIBRARIES}
|
|
||||||
${LIBSOLV_LIBRARY}
|
|
||||||
${LIBSOLV_EXT_LIBRARY}
|
|
||||||
- ${OPENSSL_CRYPTO_LIBRARY}
|
|
||||||
${RPM_LIBRARIES}
|
|
||||||
${SCOLS_LIBRARIES}
|
|
||||||
${SQLite3_LIBRARIES}
|
|
||||||
diff --git a/libdnf/utils/CMakeLists.txt b/libdnf/utils/CMakeLists.txt
|
|
||||||
index 71a1042c..4ec456ef 100644
|
|
||||||
--- a/libdnf/utils/CMakeLists.txt
|
|
||||||
+++ b/libdnf/utils/CMakeLists.txt
|
|
||||||
@@ -1,5 +1,4 @@
|
|
||||||
add_subdirectory(bgettext)
|
|
||||||
-add_subdirectory(crypto)
|
|
||||||
add_subdirectory(iniparser)
|
|
||||||
add_subdirectory(regex)
|
|
||||||
add_subdirectory(sqlite3)
|
|
||||||
diff --git a/libdnf/utils/crypto/CMakeLists.txt b/libdnf/utils/crypto/CMakeLists.txt
|
|
||||||
deleted file mode 100644
|
|
||||||
index 149d100c..00000000
|
|
||||||
--- a/libdnf/utils/crypto/CMakeLists.txt
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,5 +0,0 @@
|
|
||||||
-set(UTILS_SOURCES
|
|
||||||
- ${UTILS_SOURCES}
|
|
||||||
- ${CMAKE_CURRENT_SOURCE_DIR}/sha1.cpp
|
|
||||||
- PARENT_SCOPE
|
|
||||||
-)
|
|
||||||
diff --git a/libdnf/utils/crypto/sha1.cpp b/libdnf/utils/crypto/sha1.cpp
|
|
||||||
deleted file mode 100644
|
|
||||||
index 1533ee6b..00000000
|
|
||||||
--- a/libdnf/utils/crypto/sha1.cpp
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,36 +0,0 @@
|
|
||||||
-#include <cstring>
|
|
||||||
-
|
|
||||||
-#include <iomanip>
|
|
||||||
-#include <sstream>
|
|
||||||
-
|
|
||||||
-#include "sha1.hpp"
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-SHA1Hash::SHA1Hash()
|
|
||||||
-{
|
|
||||||
- md_ctx = EVP_MD_CTX_new();
|
|
||||||
- EVP_DigestInit_ex(md_ctx, EVP_sha1(), NULL);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-void
|
|
||||||
-SHA1Hash::update(const char * data)
|
|
||||||
-{
|
|
||||||
- EVP_DigestUpdate(md_ctx, data, strlen(data));
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-std::string
|
|
||||||
-SHA1Hash::hexdigest()
|
|
||||||
-{
|
|
||||||
- unsigned char md[digestLength];
|
|
||||||
- EVP_DigestFinal_ex(md_ctx, md, NULL);
|
|
||||||
-
|
|
||||||
- std::stringstream ss;
|
|
||||||
- for(int i=0; i<digestLength; i++) {
|
|
||||||
- ss << std::setfill('0') << std::setw(2) << std::hex << static_cast<int>(md[i]);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- EVP_MD_CTX_free(md_ctx);
|
|
||||||
- return ss.str();
|
|
||||||
-}
|
|
||||||
diff --git a/libdnf/utils/crypto/sha1.hpp b/libdnf/utils/crypto/sha1.hpp
|
|
||||||
deleted file mode 100644
|
|
||||||
index 9f1dfdeb..00000000
|
|
||||||
--- a/libdnf/utils/crypto/sha1.hpp
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,25 +0,0 @@
|
|
||||||
-#include <string>
|
|
||||||
-#include <openssl/sha.h>
|
|
||||||
-#include <openssl/evp.h>
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
-USAGE:
|
|
||||||
-
|
|
||||||
-SHA1Hash h;
|
|
||||||
-h.update("foo");
|
|
||||||
-h.update("bar");
|
|
||||||
-std::cout << h.hexdigest() << std::endl;
|
|
||||||
-*/
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-class SHA1Hash {
|
|
||||||
-public:
|
|
||||||
- SHA1Hash();
|
|
||||||
- void update(const char *data);
|
|
||||||
- std::string hexdigest();
|
|
||||||
- static constexpr int digestLength = SHA_DIGEST_LENGTH;
|
|
||||||
-
|
|
||||||
-private:
|
|
||||||
- EVP_MD_CTX *md_ctx;
|
|
||||||
-};
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 35a3cebb3b23b3ba9001e3d4f9f0ef5e59c499f0 Mon Sep 17 00:00:00 2001
|
From c17e59faf6075e7ddb803f6393e86653afd6b16d Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
||||||
Date: Mon, 30 May 2022 08:59:41 +0200
|
Date: Mon, 30 May 2022 08:59:41 +0200
|
||||||
Subject: [PATCH 4/5] advisory upgrade: filter out advPkgs with different arch
|
Subject: [PATCH] advisory upgrade: filter out advPkgs with different arch
|
||||||
|
|
||||||
This prevents a situation in security upgrades where libsolv cannot
|
This prevents a situation in security upgrades where libsolv cannot
|
||||||
upgrade dependent pkgs because we ask for an upgrade of different arch:
|
upgrade dependent pkgs because we ask for an upgrade of different arch:
|
||||||
@ -96,5 +96,5 @@ index ac2736b5..03d39659 100644
|
|||||||
for (auto & advisoryPkg : pkgs) {
|
for (auto & advisoryPkg : pkgs) {
|
||||||
if (cmp_type & HY_UPGRADE) {
|
if (cmp_type & HY_UPGRADE) {
|
||||||
--
|
--
|
||||||
2.37.1
|
2.36.1
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
From 83d6c019360823504fe27284fdf4804943bb2033 Mon Sep 17 00:00:00 2001
|
From 549d248c9b331d19a0fd355fc605ab8912ed50f6 Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
||||||
Date: Tue, 5 Jul 2022 09:02:22 +0200
|
Date: Tue, 5 Jul 2022 09:02:22 +0200
|
||||||
Subject: [PATCH 5/5] Add obsoletes to filtering for advisory candidates
|
Subject: [PATCH] Add obsoletes to filtering for advisory candidates
|
||||||
|
|
||||||
Patch https://github.com/rpm-software-management/libdnf/pull/1526
|
Patch https://github.com/rpm-software-management/libdnf/pull/1526
|
||||||
introduced a regression where we no longer do a security upgrade if a
|
introduced a regression where we no longer do a security upgrade if a
|
||||||
@ -67,5 +67,5 @@ index 03d39659..5355f9f7 100644
|
|||||||
if (low != installed_solvables.end() && s->name == (*low)->name && s->arch == (*low)->arch) {
|
if (low != installed_solvables.end() && s->name == (*low)->name && s->arch == (*low)->arch) {
|
||||||
candidates.push_back(s);
|
candidates.push_back(s);
|
||||||
--
|
--
|
||||||
2.37.1
|
2.36.1
|
||||||
|
|
@ -1,70 +0,0 @@
|
|||||||
From 025d477f63baf3df2f6da3b10a21f00d4a339073 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jaroslav Mracek <jmracek@redhat.com>
|
|
||||||
Date: Tue, 8 Feb 2022 09:30:03 +0100
|
|
||||||
Subject: [PATCH] Skip rich deps for autodetection of unmet dependencies (RhBug:2033130, 2048394)
|
|
||||||
|
|
||||||
Rich dependencies are difficult to properly evaluate because we do not
|
|
||||||
have enough information about past and only libsolv is capable to
|
|
||||||
evaluate it in comparison to present state of the system.
|
|
||||||
|
|
||||||
Additionally - rich deps are used for langpacks therefore disabling
|
|
||||||
unmet rich deps will have a negative impact on UX.
|
|
||||||
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2048394
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2033130
|
|
||||||
---
|
|
||||||
libdnf/goal/Goal.cpp | 22 +++++++++++++++++++---
|
|
||||||
1 file changed, 19 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
|
|
||||||
index 2b698f7..ebe2fbd 100644
|
|
||||||
--- a/libdnf/goal/Goal.cpp
|
|
||||||
+++ b/libdnf/goal/Goal.cpp
|
|
||||||
@@ -835,8 +835,12 @@ Goal::exclude_from_weak_autodetect()
|
|
||||||
installed_names.push_back(dnf_package_get_name(pkg));
|
|
||||||
std::unique_ptr<libdnf::DependencyContainer> recommends(dnf_package_get_recommends(pkg));
|
|
||||||
for (int i = 0; i < recommends->count(); ++i) {
|
|
||||||
- Query query(base_query);
|
|
||||||
std::unique_ptr<libdnf::Dependency> dep(recommends->getPtr(i));
|
|
||||||
+ const char * dep_string = dep->toString();
|
|
||||||
+ if (dep_string[0] == '(') {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ Query query(base_query);
|
|
||||||
const char * version = dep->getVersion();
|
|
||||||
// There can be installed provider in different version or upgraded packed can recommend a different version
|
|
||||||
// Ignore version and search only by reldep name
|
|
||||||
@@ -858,7 +862,7 @@ Goal::exclude_from_weak_autodetect()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- // Invesigate supplements of only available packages with a different name to installed packages
|
|
||||||
+ // Investigate supplements of only available packages with a different name to installed packages
|
|
||||||
installed_names.push_back(nullptr);
|
|
||||||
base_query.addFilter(HY_PKG_NAME, HY_NEQ, installed_names.data());
|
|
||||||
auto * available_pset = base_query.getResultPset();
|
|
||||||
@@ -870,8 +874,20 @@ Goal::exclude_from_weak_autodetect()
|
|
||||||
if (supplements->count() == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
+ libdnf::DependencyContainer supplements_without_rich(getSack());
|
|
||||||
+ for (int i = 0; i < supplements->count(); ++i) {
|
|
||||||
+ std::unique_ptr<libdnf::Dependency> dep(supplements->getPtr(i));
|
|
||||||
+ const char * dep_string = dep->toString();
|
|
||||||
+ if (dep_string[0] == '(') {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ supplements_without_rich.add(dep.get());
|
|
||||||
+ }
|
|
||||||
+ if (supplements_without_rich.count() == 0) {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
Query query(installed_query);
|
|
||||||
- query.addFilter(HY_PKG_PROVIDES, supplements.get());
|
|
||||||
+ query.addFilter(HY_PKG_PROVIDES, &supplements_without_rich);
|
|
||||||
// When supplemented package already installed, exclude_from_weak available package
|
|
||||||
if (!query.empty()) {
|
|
||||||
add_exclude_from_weak(pkg);
|
|
||||||
--
|
|
||||||
libgit2 1.1.0
|
|
||||||
|
|
3454
SOURCES/0003-Update-translations-RHEL-9.1.patch
Normal file
3454
SOURCES/0003-Update-translations-RHEL-9.1.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
|||||||
%global libsolv_version 0.7.20
|
%global libsolv_version 0.7.21
|
||||||
%global libmodulemd_version 2.13.0
|
%global libmodulemd_version 2.13.0
|
||||||
%global librepo_version 1.13.1
|
%global librepo_version 1.13.1
|
||||||
%global dnf_conflict 4.10.0-4
|
%global dnf_conflict 4.10.0-4
|
||||||
%global swig_version 3.0.12
|
%global swig_version 3.0.12
|
||||||
%global libdnf_major_version 0
|
%global libdnf_major_version 0
|
||||||
%global libdnf_minor_version 65
|
%global libdnf_minor_version 67
|
||||||
%global libdnf_micro_version 0
|
%global libdnf_micro_version 0
|
||||||
|
|
||||||
%define __cmake_in_source_build 1
|
%define __cmake_in_source_build 1
|
||||||
@ -56,21 +56,18 @@
|
|||||||
|
|
||||||
Name: libdnf
|
Name: libdnf
|
||||||
Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version}
|
Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version}
|
||||||
Release: 5.1%{?dist}.alma
|
Release: 3%{?dist}.alma
|
||||||
Summary: Library providing simplified C and Python API to libsolv
|
Summary: Library providing simplified C and Python API to libsolv
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://github.com/rpm-software-management/libdnf
|
URL: https://github.com/rpm-software-management/libdnf
|
||||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
Patch1: 0001-Use-rpmdbCookie-from-librpm-remove-hawkey.Sack._rpmd.patch
|
Patch1: 0001-advisory-upgrade-filter-out-advPkgs-with-different-a.patch
|
||||||
Patch2: 0002-Skip-rich-deps-for-autodetection-of-unmet-dependencies-RhBug2033130-2048394.patch
|
Patch2: 0002-Add-obsoletes-to-filtering-for-advisory-candidates.patch
|
||||||
Patch3: 0003-Update-translations-RhBug-2017349.patch
|
Patch3: 0003-Update-translations-RHEL-9.1.patch
|
||||||
Patch4: 0004-advisory-upgrade-filter-out-advPkgs-with-different-a.patch
|
|
||||||
Patch5: 0005-Add-obsoletes-to-filtering-for-advisory-candidates.patch
|
|
||||||
|
|
||||||
# Almalinux patches
|
# Almalinux patches
|
||||||
Patch10001: almalinux_bugtracker.patch
|
Patch10001: almalinux_bugtracker.patch
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -82,7 +79,7 @@ BuildRequires: valgrind
|
|||||||
%endif
|
%endif
|
||||||
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0
|
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0
|
||||||
BuildRequires: pkgconfig(gtk-doc)
|
BuildRequires: pkgconfig(gtk-doc)
|
||||||
BuildRequires: rpm-devel >= 4.11.0
|
BuildRequires: rpm-devel >= 4.15.0
|
||||||
%if %{with rhsm}
|
%if %{with rhsm}
|
||||||
BuildRequires: pkgconfig(librhsm) >= 0.0.3
|
BuildRequires: pkgconfig(librhsm) >= 0.0.3
|
||||||
%endif
|
%endif
|
||||||
@ -313,18 +310,24 @@ popd
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Sep 20 2022 Eduard Abdullin <eabdullin@almalinux.org> - 0.65.0-5.1.alma
|
* Tue Nov 15 2022 Eduard Abdullin <eabdullin@almalinux.org> - 0.67.0-3.alma
|
||||||
- Added patch for almalinux bugtracker
|
- Added patch for almalinux bugtracker
|
||||||
|
|
||||||
* Wed Aug 17 2022 Lukas Hrazky <lhrazky@redhat.com> - 0.65.0-5.1
|
* Thu Sep 15 2022 Marek Blaha <mblaha@redhat.com> - 0.67.0-3
|
||||||
- advisory upgrade: filter out advPkgs with different arch
|
|
||||||
- Add obsoletes to filtering for advisory candidates
|
|
||||||
|
|
||||||
* Mon Mar 21 2022 Marek Blaha <mblaha@redhat.com> - 0.65.0-5
|
|
||||||
- Update translations
|
- Update translations
|
||||||
|
|
||||||
* Fri Mar 11 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.65.0-4
|
* Thu Jul 21 2022 Lukas Hrazky <lhrazky@redhat.com> - 0.67.0-2
|
||||||
- Skip rich deps for autodetection of unmet dependencies (RhBug:2048394)
|
- Add obsoletes to filtering for advisory candidates
|
||||||
|
- advisory upgrade: filter out advPkgs with different arch
|
||||||
|
|
||||||
|
* Thu Apr 28 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.67.0-1
|
||||||
|
- Fix handling transaction id in resolveTransactionItemReason (RhBug:2010259,2053014)
|
||||||
|
- Remove deprecated assertions (RhBug:2027383)
|
||||||
|
- Skip rich deps for autodetection of unmet dependencies (RhBug:2033130, 2048394)
|
||||||
|
- Increase required rpm version since we use `rpmdbCookie()`
|
||||||
|
- Add 'loongarch' support
|
||||||
|
- Use dnf solv userdata to check versions and checksum (RhBug:2027445)
|
||||||
|
- context: Substitute all repository config options (RhBug:2076853)
|
||||||
|
|
||||||
* Mon Feb 07 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.65.0-3
|
* Mon Feb 07 2022 Pavla Kratochvilova <pkratoch@redhat.com> - 0.65.0-3
|
||||||
- Use `rpmdbCookie` from librpm, remove `hawkey.Sack._rpmdb_version`
|
- Use `rpmdbCookie` from librpm, remove `hawkey.Sack._rpmdb_version`
|
||||||
|
Loading…
Reference in New Issue
Block a user