rebuilt with rpm 4.19.1.1 [release 0.73.1-2mamba;Mon May 13 2024]

This commit is contained in:
Automatic Build System 2024-05-18 19:49:54 +02:00
parent e154cfcf3c
commit 6a897d84ec
4 changed files with 24 additions and 929 deletions

View File

@ -1,358 +0,0 @@
diff -ru libdnf-0.22.0/libdnf/dnf-rpmts.cpp libdnf-0.22.0.patched/libdnf/dnf-rpmts.cpp
--- libdnf-0.22.0/libdnf/dnf-rpmts.cpp 2019-06-02 12:19:17.767417367 +0200
+++ libdnf-0.22.0.patched/libdnf/dnf-rpmts.cpp 2019-06-02 11:56:44.647788759 +0200
@@ -193,7 +193,7 @@
while (rpmpsNextIterator(psi) >= 0) {
g_autofree gchar *msg = NULL;
prob = rpmpsGetProblem(psi);
- msg = rpmProblemString(prob);
+ msg = (gchar*)rpmProblemString(prob);
g_string_append(string, msg);
g_string_append(string, "\n");
}
@@ -268,7 +268,7 @@
/* find package by db-id */
recOffset = dnf_package_get_rpmdbid(pkg);
rpmlogSetCallback(dnf_rpmts_log_handler_cb, &rpm_error);
- iter = rpmtsInitIterator(ts, RPMDBI_PACKAGES,
+ iter = rpmtsInitIterator(ts, (rpmTag)RPMDBI_PACKAGES,
&recOffset, sizeof(recOffset));
if (iter == NULL) {
if (rpm_error != NULL) {
diff -ru libdnf-0.22.0/libdnf/dnf-transaction.cpp libdnf-0.22.0.patched/libdnf/dnf-transaction.cpp
--- libdnf-0.22.0/libdnf/dnf-transaction.cpp 2019-06-02 12:19:17.768417372 +0200
+++ libdnf-0.22.0.patched/libdnf/dnf-transaction.cpp 2019-06-02 12:10:17.656626376 +0200
@@ -1062,8 +1062,8 @@
GPtrArray *pkglist;
DnfPackage *pkg;
DnfPackage *pkg_tmp;
- rpmprobFilterFlags problems_filter = 0;
- rpmtransFlags rpmts_flags = RPMTRANS_FLAG_NONE;
+ int problems_filter = 0;
+ int rpmts_flags = RPMTRANS_FLAG_NONE;
DnfTransactionPrivate *priv = GET_PRIVATE(transaction);
libdnf::Swdb *swdb = priv->swdb;
@@ -1306,8 +1306,8 @@
goto out;
/* no signature checking, we've handled that already */
- vs_flags = rpmtsSetVSFlags(priv->ts, _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS);
- rpmtsSetVSFlags(priv->ts, vs_flags);
+ vs_flags = rpmtsSetVSFlags(priv->ts, (rpmVSFlags)(_RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS));
+ rpmtsSetVSFlags(priv->ts, (rpmVSFlags)vs_flags);
/* filter diskspace */
if (!dnf_context_get_check_disk_space(priv->context))
@@ -1326,10 +1326,10 @@
priv->state = dnf_state_get_child(state);
priv->step = DNF_TRANSACTION_STEP_IGNORE;
- rpmtsSetFlags(priv->ts, rpmts_flags);
+ rpmtsSetFlags(priv->ts, (rpmtransFlags)rpmts_flags);
g_debug("Running transaction in test mode");
dnf_state_set_allow_cancel(state, FALSE);
- rc = rpmtsRun(priv->ts, NULL, problems_filter);
+ rc = rpmtsRun(priv->ts, NULL, (rpmprobFilterFlags)problems_filter);
if (rc < 0) {
ret = FALSE;
g_set_error(error,
@@ -1359,10 +1359,10 @@
/* run the transaction */
priv->state = dnf_state_get_child(state);
priv->step = DNF_TRANSACTION_STEP_STARTED;
- rpmtsSetFlags(priv->ts, rpmts_flags);
+ rpmtsSetFlags(priv->ts, (rpmtransFlags)rpmts_flags);
g_debug("Running actual transaction");
dnf_state_set_allow_cancel(state, FALSE);
- rc = rpmtsRun(priv->ts, NULL, problems_filter);
+ rc = rpmtsRun(priv->ts, NULL, (rpmprobFilterFlags)problems_filter);
if (rc < 0) {
ret = FALSE;
g_set_error(
diff -ru libdnf-0.22.0/libdnf/repo/solvable/Package.cpp libdnf-0.22.0.patched/libdnf/repo/solvable/Package.cpp
--- libdnf-0.22.0/libdnf/repo/solvable/Package.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0.patched/libdnf/repo/solvable/Package.cpp 2019-06-02 12:15:17.288215714 +0200
@@ -3,12 +3,12 @@
#include <utility>
#include "DependencyContainer.hpp"
-Package::Package(DnfSack *sack, Id id)
+Package_::Package_(DnfSack *sack, Id id)
: sack(sack)
, id(id)
{}
-Package::Package(DnfSack *sack,
+Package_::Package_(DnfSack *sack,
HyRepo repo,
const char *name,
const char *version,
@@ -22,7 +22,7 @@
}
}
-Package::Package(DnfSack *sack,
+Package_::Package_(DnfSack *sack,
HyRepo repo,
const std::string &name,
const std::string &version,
@@ -36,148 +36,148 @@
}
}
-Package::Package(const Package &package)
+Package_::Package_(const Package_ &package)
: sack(package.sack)
, id(package.id)
{}
-Package::~Package() = default;
+Package_::~Package_() = default;
-const char *Package::getSolvableName() const
+const char *Package_::getSolvableName() const
{
Pool *pool = dnf_sack_get_pool(sack);
Solvable *solvable = pool_id2solvable(pool, id);
return pool_id2str(pool, solvable->name);
}
-const char *Package::getSolvableEvr() const
+const char *Package_::getSolvableEvr() const
{
Pool *pool = dnf_sack_get_pool(sack);
Solvable *solvable = pool_id2solvable(pool, id);
return pool_id2str(pool, solvable->evr);
}
-const char *Package::getArch() const
+const char *Package_::getArch() const
{
Pool *pool = dnf_sack_get_pool(sack);
Solvable *solvable = pool_id2solvable(pool, id);
return pool_id2str(pool, solvable->arch);
}
-const char *Package::getSolvableVendor() const
+const char *Package_::getSolvableVendor() const
{
Pool *pool = dnf_sack_get_pool(sack);
Solvable *solvable = pool_id2solvable(pool, id);
return pool_id2str(pool, solvable->vendor);
}
-void Package::setSolvableVendor(const char *vendor)
+void Package_::setSolvableVendor(const char *vendor)
{
Solvable *solvable = pool_id2solvable(dnf_sack_get_pool(sack), id);
solvable_set_str(solvable, SOLVABLE_VENDOR, vendor);
}
-Id Package::getId() const
+Id Package_::getId() const
{
return id;
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getConflicts() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getConflicts() const
{
return getDependencies(SOLVABLE_CONFLICTS);
};
-std::shared_ptr<libdnf::DependencyContainer> Package::getEnhances() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getEnhances() const
{
return getDependencies(SOLVABLE_ENHANCES);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getObsoletes() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getObsoletes() const
{
return getDependencies(SOLVABLE_OBSOLETES);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getProvides() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getProvides() const
{
return getDependencies(SOLVABLE_PROVIDES);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getRecommends() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getRecommends() const
{
return getDependencies(SOLVABLE_RECOMMENDS);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getRequires() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getRequires() const
{
return getDependencies(SOLVABLE_REQUIRES, 0);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getRequiresPre() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getRequiresPre() const
{
return getDependencies(SOLVABLE_REQUIRES, 1);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getSuggests() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getSuggests() const
{
return getDependencies(SOLVABLE_SUGGESTS);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getSupplements() const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getSupplements() const
{
return getDependencies(SOLVABLE_SUPPLEMENTS);
}
-void Package::addConflicts(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addConflicts(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_CONFLICTS);
}
-void Package::addEnhances(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addEnhances(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_ENHANCES);
}
-void Package::addObsoletes(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addObsoletes(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_OBSOLETES);
}
-void Package::addProvides(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addProvides(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_PROVIDES);
}
-void Package::addRecommends(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addRecommends(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_RECOMMENDS);
}
-void Package::addRequires(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addRequires(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_REQUIRES, 0);
}
-void Package::addRequiresPre(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addRequiresPre(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_REQUIRES, 1);
}
-void Package::addSuggests(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addSuggests(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_SUGGESTS);
}
-void Package::addSupplements(std::shared_ptr<libdnf::Dependency> dependency)
+void Package_::addSupplements(std::shared_ptr<libdnf::Dependency> dependency)
{
addDependency(std::move(dependency), SOLVABLE_SUPPLEMENTS);
}
-void Package::createSolvable(HyRepo repo)
+void Package_::createSolvable(HyRepo repo)
{
id = repo_add_solvable(repo->libsolv_repo);
}
-void Package::fillSolvableData(const char *name, const char *version,
+void Package_::fillSolvableData(const char *name, const char *version,
const char *arch) const
{
Solvable *solvable = pool_id2solvable(dnf_sack_get_pool(sack), id);
@@ -187,7 +187,7 @@
solvable_set_str(solvable, SOLVABLE_ARCH, arch);
}
-std::shared_ptr<libdnf::DependencyContainer> Package::getDependencies(Id type, Id marker) const
+std::shared_ptr<libdnf::DependencyContainer> Package_::getDependencies(Id type, Id marker) const
{
auto queue = getDependencyQueue(type, marker);
auto container = std::make_shared<libdnf::DependencyContainer>(sack, *queue);
@@ -198,7 +198,7 @@
return container;
}
-Queue *Package::getDependencyQueue(Id type, Id marker) const
+Queue *Package_::getDependencyQueue(Id type, Id marker) const
{
Queue dependencyQueue{};
auto queue = static_cast<Queue *>(malloc(sizeof(Queue)));
@@ -219,7 +219,7 @@
return queue;
}
-void Package::addDependency(std::shared_ptr<libdnf::Dependency> dependency, int type, Id marker)
+void Package_::addDependency(std::shared_ptr<libdnf::Dependency> dependency, int type, Id marker)
{
Solvable *solvable = pool_id2solvable(dnf_sack_get_pool(sack), id);
solvable_add_deparray(solvable, type, dependency->getId(), marker);
diff -ru libdnf-0.22.0/libdnf/repo/solvable/Package.hpp libdnf-0.22.0.patched/libdnf/repo/solvable/Package.hpp
--- libdnf-0.22.0/libdnf/repo/solvable/Package.hpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0.patched/libdnf/repo/solvable/Package.hpp 2019-06-02 11:33:12.717551563 +0200
@@ -11,12 +11,12 @@
#include "Dependency.hpp"
-struct Package
+struct Package_
{
public:
- Package(DnfSack *sack, Id id);
- Package(const Package &package);
- virtual ~Package();
+ Package_(DnfSack *sack, Id id);
+ Package_(const Package_ &package);
+ virtual ~Package_();
std::shared_ptr<libdnf::DependencyContainer> getConflicts() const;
std::shared_ptr<libdnf::DependencyContainer> getEnhances() const;
@@ -34,8 +34,8 @@
const char *getArch() const;
protected:
- Package(DnfSack *sack, HyRepo repo, const char *name, const char *version, const char *arch, bool createSolvable = true);
- Package(DnfSack *sack, HyRepo repo, const std::string &name, const std::string &version, const std::string &arch, bool createSolvable = true);
+ Package_(DnfSack *sack, HyRepo repo, const char *name, const char *version, const char *arch, bool createSolvable = true);
+ Package_(DnfSack *sack, HyRepo repo, const std::string &name, const std::string &version, const std::string &arch, bool createSolvable = true);
void addConflicts(std::shared_ptr<libdnf::Dependency> dependency);
void addEnhances(std::shared_ptr<libdnf::Dependency> dependency);
diff -ru libdnf-0.22.0/tests/libdnf/repo/PackageInstantiable.cpp libdnf-0.22.0.patched/tests/libdnf/repo/PackageInstantiable.cpp
--- libdnf-0.22.0/tests/libdnf/repo/PackageInstantiable.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0.patched/tests/libdnf/repo/PackageInstantiable.cpp 2019-06-02 12:17:06.988770015 +0200
@@ -5,7 +5,7 @@
const char *name,
const char *version,
const char *arch)
- : Package(sack, repo, name, version, arch)
+ : Package_(sack, repo, name, version, arch)
{
addProvides(std::make_shared<libdnf::Dependency>(sack, "rpm = 1.0"));
}
diff -ru libdnf-0.22.0/tests/libdnf/repo/PackageInstantiable.hpp libdnf-0.22.0.patched/tests/libdnf/repo/PackageInstantiable.hpp
--- libdnf-0.22.0/tests/libdnf/repo/PackageInstantiable.hpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0.patched/tests/libdnf/repo/PackageInstantiable.hpp 2019-06-02 12:16:36.165615422 +0200
@@ -3,7 +3,7 @@
#include "libdnf/repo/solvable/Package.hpp"
-class PackageInstantiable : public Package
+class PackageInstantiable : public Package_
{
public:
PackageInstantiable(DnfSack *sack, HyRepo repo, const char *name, const char *version, const char *arch);

View File

@ -1,22 +0,0 @@
diff -ru libdnf-0.11.1.good/libdnf/dnf-keyring.h libdnf-0.11.1/libdnf/dnf-keyring.h
--- libdnf-0.11.1.good/libdnf/dnf-keyring.h 2019-06-01 12:44:55.271022533 +0200
+++ libdnf-0.11.1/libdnf/dnf-keyring.h 2019-06-01 12:45:34.318205068 +0200
@@ -24,6 +24,7 @@
#include <glib.h>
+#include <rpm/rpm46compat.h>
#include <rpm/rpmts.h>
gboolean dnf_keyring_add_public_key (const rpmts ts,
diff -ru libdnf-0.11.1.good/libdnf/dnf-repo.cpp libdnf-0.11.1/libdnf/dnf-repo.cpp
--- libdnf-0.11.1.good/libdnf/dnf-repo.cpp 2019-06-01 12:41:19.347019561 +0200
+++ libdnf-0.11.1/libdnf/dnf-repo.cpp 2019-06-01 12:45:34.318205068 +0200
@@ -39,6 +39,7 @@
#include <glib/gstdio.h>
#include "hy-util.h"
#include <librepo/librepo.h>
+#include <rpm/rpm46compat.h>
#include <rpm/rpmts.h>
#include "dnf-keyring.h"

View File

@ -1,531 +0,0 @@
--- libdnf-0.11.1/libdnf/rpmorg-compat.h.orig 1970-01-01 01:00:00.000000000 +0100
+++ libdnf-0.11.1/libdnf/rpmorg-compat.h 2018-05-27 11:32:14.263706303 +0200
@@ -0,0 +1,64 @@
+#ifndef RPMORG_COMPAT_H
+#define RPMORG_COMPAT_H
+
+#include <rpm/rpm46compat.h>
+
+#define _RPMVSF_NOSIGNATURES (RPMVSF_NODSAHEADER | RPMVSF_NORSAHEADER | RPMVSF_NODSA | RPMVSF_NORSA)
+#define _RPMVSF_NODIGESTS (RPMVSF_NOSHA1HEADER | RPMVSF_NOMD5HEADER | RPMVSF_NOSHA1 | RPMVSF_NOMD5)
+
+static inline const char * headerGetString(Header h, rpmTag tag)
+{
+ const char *res = NULL;
+ struct rpmtd_s td;
+
+ if (headerGet(h, tag, &td, HEADERGET_MINMEM)) {
+ if (rpmtdCount(&td) == 1) {
+ res = rpmtdGetString(&td);
+ }
+ rpmtdFreeData(&td);
+ }
+ return res;
+}
+
+static inline uint64_t rpmtdGetNumber(rpmtd td)
+{
+ uint64_t val = 0;
+ int ix;
+ assert(td != NULL);
+ ix = (td->ix >= 0 ? td->ix : 0);
+
+ switch (td->type) {
+ case RPM_INT64_TYPE:
+ val = *((uint64_t *) td->data + ix);
+ break;
+ case RPM_INT32_TYPE:
+ val = *((uint32_t *) td->data + ix);
+ break;
+ case RPM_INT16_TYPE:
+ val = *((uint16_t *) td->data + ix);
+ break;
+ case RPM_INT8_TYPE:
+ case RPM_CHAR_TYPE:
+ val = *((uint8_t *) td->data + ix);
+ break;
+ default:
+ break;
+ }
+ return val;
+}
+
+static inline uint64_t headerGetNumber(Header h, rpmTag tag)
+{
+ uint64_t res = 0;
+ struct rpmtd_s td;
+
+ if (headerGet(h, tag, &td, HEADERGET_EXT)) {
+ if (rpmtdCount(&td) == 1) {
+ res = rpmtdGetNumber(&td);
+ }
+ rpmtdFreeData(&td);
+ }
+ return res;
+}
+
+#endif /* RPMORG_COMPAT_H */
diff -ru libdnf-0.22.0.orig/CMakeLists.txt libdnf-0.22.0/CMakeLists.txt
--- libdnf-0.22.0.orig/CMakeLists.txt 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/CMakeLists.txt 2019-06-02 10:44:31.421947961 +0200
@@ -54,6 +54,8 @@
pkg_check_modules(SMARTCOLS REQUIRED smartcols)
FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
find_package (LibSolv 0.6.30 REQUIRED COMPONENTS ext)
+PKG_CHECK_MODULES(RPM rpm REQUIRED)
+include_directories (${RPM_INCLUDE_DIRS})
if (ENABLE_RHSM_SUPPORT)
pkg_check_modules (RHSM REQUIRED librhsm>=0.0.3)
include_directories (${RHSM_INCLUDE_DIRS})
@@ -96,13 +98,14 @@
# rpm:
FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
-IF (NOT RPMDB_LIBRARY)
- FIND_LIBRARY (RPMDB_LIBRARY NAMES rpm)
-ENDIF (NOT RPMDB_LIBRARY)
+FIND_LIBRARY (RPMLIB_LIBRARY NAMES rpm)
FIND_LIBRARY (RPMIO_LIBRARY NAMES rpmio)
IF (RPMIO_LIBRARY)
SET(RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY})
ENDIF (RPMIO_LIBRARY)
+IF (RPMLIB_LIBRARY)
+ SET(RPMDB_LIBRARY ${RPMDB_LIBRARY} ${RPMLIB_LIBRARY})
+ENDIF (RPMLIB_LIBRARY)
pkg_check_modules(SQLite3 sqlite3 REQUIRED)
diff -ru libdnf-0.22.0.orig/libdnf/dnf-context.cpp libdnf-0.22.0/libdnf/dnf-context.cpp
--- libdnf-0.22.0.orig/libdnf/dnf-context.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-context.cpp 2019-06-02 10:38:31.050550741 +0200
@@ -36,7 +36,7 @@
#include <string>
#include <vector>
#include <gio/gio.h>
-#include <rpm/rpmlib.h>
+#include "rpmorg-compat.h"
#include <rpm/rpmmacro.h>
#include <rpm/rpmts.h>
#include <rpm/rpmdb.h>
@@ -328,9 +328,9 @@
return priv->base_arch;
/* get info from RPM */
- rpmGetOsInfo(&value, NULL);
+ value = rpmExpand("%{_target_os}", NULL);
priv->os_info = g_strdup(value);
- rpmGetArchInfo(&value, NULL);
+ value = rpmExpand("%{_target_cpu}", NULL);
priv->arch_info = g_strdup(value);
/* find the base architecture */
diff -ru libdnf-0.22.0.orig/libdnf/dnf-keyring.cpp libdnf-0.22.0/libdnf/dnf-keyring.cpp
--- libdnf-0.22.0.orig/libdnf/dnf-keyring.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-keyring.cpp 2019-06-02 10:48:29.955925592 +0200
@@ -32,7 +32,9 @@
#include <stdlib.h>
#include <glib.h>
-#include <rpm/rpmlib.h>
+#include "rpmorg-compat.h"
+#include <rpm/rpmcli.h>
+#include <rpm/rpmio.h>
#include <rpm/rpmts.h>
#include "dnf-types.h"
@@ -52,7 +54,7 @@
* Since: 0.1.0
**/
gboolean
-dnf_keyring_add_public_key(rpmKeyring keyring,
+dnf_keyring_add_public_key(const rpmts ts,
const gchar *filename,
GError **error)
{
@@ -60,10 +62,7 @@
gint rc;
gsize len;
pgpArmor armor;
- pgpDig dig = NULL;
- rpmPubkey pubkey = NULL;
uint8_t *pkt = NULL;
- g_autofree gchar *data = NULL;
/* ignore symlinks and directories */
if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR))
@@ -71,13 +70,8 @@
if (g_file_test(filename, G_FILE_TEST_IS_SYMLINK))
goto out;
- /* get data */
- ret = g_file_get_contents(filename, &data, &len, error);
- if (!ret)
- goto out;
-
/* rip off the ASCII armor and parse it */
- armor = pgpParsePkts(data, &pkt, &len);
+ armor = pgpReadPkts(filename, &pkt, &len);
if (armor < 0) {
ret = FALSE;
g_set_error(error,
@@ -100,7 +94,7 @@
}
/* test each one */
- pubkey = rpmPubkeyNew(pkt, len);
+/* pubkey = rpmPubkeyNew(pkt, len);
if (pubkey == NULL) {
ret = FALSE;
g_set_error(error,
@@ -109,19 +103,19 @@
"failed to parse public key for %s",
filename);
goto out;
- }
+ } */
/* does the key exist in the keyring */
- dig = rpmPubkeyDig(pubkey);
+/* dig = rpmPubkeyDig(pubkey);
rc = rpmKeyringLookup(keyring, dig);
if (rc == RPMRC_OK) {
ret = TRUE;
g_debug("%s is already present", filename);
goto out;
- }
+ } */
/* add to rpmdb automatically, without a prompt */
- rc = rpmKeyringAddKey(keyring, pubkey);
+ rc = rpmcliImportPubkey(ts, pkt, len);
if (rc == 1) {
ret = TRUE;
g_debug("%s is already added", filename);
@@ -142,10 +136,10 @@
out:
if (pkt != NULL)
free(pkt); /* yes, free() */
- if (pubkey != NULL)
+/* if (pubkey != NULL)
rpmPubkeyFree(pubkey);
if (dig != NULL)
- pgpFreeDig(dig);
+ pgpFreeDig(dig); */
return ret;
}
@@ -161,7 +155,7 @@
* Since: 0.1.0
**/
gboolean
-dnf_keyring_add_public_keys(rpmKeyring keyring, GError **error)
+dnf_keyring_add_public_keys(rpmts ts, GError **error)
{
const gchar *gpg_dir = "/etc/pki/rpm-gpg";
gboolean ret = TRUE;
@@ -178,7 +172,7 @@
if (filename == NULL)
break;
path_tmp = g_build_filename(gpg_dir, filename, NULL);
- ret = dnf_keyring_add_public_key(keyring, path_tmp, error);
+ ret = dnf_keyring_add_public_key(ts, path_tmp, error);
} while (ret);
return TRUE;
}
@@ -187,7 +181,7 @@
* dnf_keyring_check_untrusted_file:
*/
gboolean
-dnf_keyring_check_untrusted_file(rpmKeyring keyring,
+dnf_keyring_check_untrusted_file(
const gchar *filename,
GError **error)
{
@@ -237,10 +231,10 @@
}
/* convert and upscale */
- headerConvert(hdr, HEADERCONV_RETROFIT_V3);
+ /*headerConvert(hdr, HEADERCONV_RETROFIT_V3);*/
/* get RSA key */
- td = rpmtdNew();
+ td = (rpmtd)malloc (sizeof (*td));
rc = static_cast<rpmRC>(headerGet(hdr, RPMTAG_RSAHEADER, td, HEADERGET_MINMEM));
if (rc != RPMRC_NOTFOUND) {
/* try to read DSA key as a fallback */
@@ -259,7 +253,7 @@
}
/* make it into a digest */
- dig = pgpNewDig();
+ dig = rpmtsDig(ts);
rc = static_cast<rpmRC>(pgpPrtPkts(static_cast<const uint8_t *>(td->data), td->count, dig, 0));
if (rc != RPMRC_OK) {
g_set_error(error,
@@ -271,7 +265,7 @@
}
/* does the key exist in the keyring */
- rc = rpmKeyringLookup(keyring, dig);
+ rc = rpmtsFindPubkey(ts, dig);
if (rc != RPMRC_OK) {
g_set_error(error,
DNF_ERROR,
@@ -286,15 +280,15 @@
ret = TRUE;
out:
if (dig != NULL)
- pgpFreeDig(dig);
+ dig = pgpDigFree(dig);
if (td != NULL) {
rpmtdFreeData(td);
- rpmtdFree(td);
+ free(td);
}
if (ts != NULL)
- rpmtsFree(ts);
+ ts = rpmtsFree(ts);
if (hdr != NULL)
- headerFree(hdr);
+ hdr = headerFree(hdr);
if (fd != NULL)
Fclose(fd);
return ret;
diff -ru libdnf-0.22.0.orig/libdnf/dnf-keyring.h libdnf-0.22.0/libdnf/dnf-keyring.h
--- libdnf-0.22.0.orig/libdnf/dnf-keyring.h 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-keyring.h 2019-06-02 10:46:47.839503435 +0200
@@ -24,16 +24,16 @@
#include <glib.h>
-#include <rpm/rpmkeyring.h>
+#include <rpm/rpmts.h>
G_BEGIN_DECLS
-gboolean dnf_keyring_add_public_key (rpmKeyring keyring,
+gboolean dnf_keyring_add_public_key (const rpmts ts,
const gchar *filename,
GError **error);
-gboolean dnf_keyring_add_public_keys (rpmKeyring keyring,
+gboolean dnf_keyring_add_public_keys (rpmts ts,
GError **error);
-gboolean dnf_keyring_check_untrusted_file (rpmKeyring keyring,
+gboolean dnf_keyring_check_untrusted_file (
const gchar *filename,
GError **error);
diff -ru libdnf-0.22.0.orig/libdnf/dnf-repo.cpp libdnf-0.22.0/libdnf/dnf-repo.cpp
--- libdnf-0.22.0.orig/libdnf/dnf-repo.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-repo.cpp 2019-06-02 10:38:31.051550744 +0200
@@ -1558,15 +1558,12 @@
GError **error)
{
gboolean ret;
- rpmKeyring keyring;
rpmts ts;
/* then import to rpmdb */
ts = rpmtsCreate();
- keyring = rpmtsGetKeyring(ts, 1);
- ret = dnf_keyring_add_public_key(keyring, tmp_path, error);
- rpmKeyringFree(keyring);
- rpmtsFree(ts);
+ ret = dnf_keyring_add_public_key(ts, tmp_path, error);
+ ts = rpmtsFree(ts);
return ret;
}
diff -ru libdnf-0.22.0.orig/libdnf/dnf-rpmts.cpp libdnf-0.22.0/libdnf/dnf-rpmts.cpp
--- libdnf-0.22.0.orig/libdnf/dnf-rpmts.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-rpmts.cpp 2019-06-02 10:38:31.051550744 +0200
@@ -32,7 +32,8 @@
#include <glib.h>
-#include <rpm/rpmlib.h>
+#define _RPMLOG_INTERNAL
+#include <rpm/rpm46compat.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmdb.h>
@@ -157,7 +158,7 @@
}
out:
Fclose(fd);
- headerFree(hdr);
+ hdr = headerFree(hdr);
return ret;
}
@@ -218,7 +219,7 @@
DNF_ERROR_INTERNAL_ERROR,
_("Error running transaction and no problems were reported!"));
out:
- rpmpsFree(probs);
+ probs = rpmpsFree(probs);
return ret;
}
@@ -231,11 +232,11 @@
GString **string =(GString **) data;
/* only log errors */
- if (rpmlogRecPriority(rec) != RPMLOG_ERR)
+ if (rec->pri != RPMLOG_ERR)
return RPMLOG_DEFAULT;
/* do not log internal BDB errors */
- if (g_strstr_len(rpmlogRecMessage(rec), -1, "BDB") != NULL)
+ if (g_strstr_len(rec->message, -1, "BDB") != NULL)
return 0;
/* create string if required */
@@ -245,7 +246,7 @@
/* if text already exists, join them */
if ((*string)->len > 0)
g_string_append(*string, ": ");
- g_string_append(*string, rpmlogRecMessage(rec));
+ g_string_append(*string, rec->message);
/* remove the trailing /n which rpm does */
if ((*string)->len > 0)
@@ -294,7 +295,7 @@
}
/* success */
- headerLink(hdr);
+ hdr = headerLink(hdr);
out:
rpmlogSetCallback(NULL, NULL);
if (iter != NULL)
@@ -340,6 +341,6 @@
}
out:
if (hdr != NULL)
- headerFree(hdr);
+ hdr = headerFree(hdr);
return ret;
}
diff -ru libdnf-0.22.0.orig/libdnf/dnf-transaction.cpp libdnf-0.22.0/libdnf/dnf-transaction.cpp
--- libdnf-0.22.0.orig/libdnf/dnf-transaction.cpp 2019-06-01 21:09:37.000000000 +0200
+++ libdnf-0.22.0/libdnf/dnf-transaction.cpp 2019-06-02 10:55:58.480821893 +0200
@@ -28,7 +28,7 @@
* This object represents an RPM transaction.
*/
-#include <rpm/rpmlib.h>
+#include "rpmorg-compat.h"
#include <rpm/rpmlog.h>
#include <rpm/rpmts.h>
@@ -56,7 +56,6 @@
} DnfTransactionStep;
typedef struct {
- rpmKeyring keyring;
rpmts ts;
DnfContext *context; /* weak reference */
GPtrArray *repos;
@@ -93,7 +92,6 @@
g_ptr_array_unref(priv->pkgs_to_download);
g_timer_destroy(priv->timer);
- rpmKeyringFree(priv->keyring);
rpmtsFree(priv->ts);
if (priv->swdb != NULL)
@@ -335,7 +333,7 @@
}
/* check file */
- if (!dnf_keyring_check_untrusted_file(priv->keyring, fn, &error_local)) {
+ if (!dnf_keyring_check_untrusted_file(fn, &error_local)) {
/* probably an i/o error */
if (!g_error_matches(error_local, DNF_ERROR, DNF_ERROR_GPG_SIGNATURE_INVALID)) {
@@ -692,22 +690,6 @@
/* don't do anything */
break;
- case RPMCALLBACK_INST_STOP:
- pkg = dnf_find_pkg_from_header(priv->install, hdr);
- if (pkg == NULL && filename != NULL) {
- pkg = dnf_find_pkg_from_filename_suffix(priv->install, filename);
- }
-
- // transaction item install complete
- _swdb_transaction_item_progress(swdb, pkg);
-
- /* phase complete */
- ret = dnf_state_done(priv->state, &error_local);
- if (!ret) {
- g_warning("state increment failed: %s", error_local->message);
- }
- break;
-
case RPMCALLBACK_UNINST_STOP:
pkg = dnf_find_pkg_from_header(priv->remove, hdr);
@@ -1025,7 +1007,7 @@
DnfTransactionPrivate *priv = GET_PRIVATE(transaction);
/* import all system wide GPG keys */
- if (!dnf_keyring_add_public_keys(priv->keyring, error))
+ if (!dnf_keyring_add_public_keys(priv->ts, error))
return FALSE;
/* import downloaded repo GPG keys */
@@ -1038,7 +1020,7 @@
const char *pubkey = *iter;
if (g_file_test(pubkey, G_FILE_TEST_EXISTS)) {
/* import */
- if (!dnf_keyring_add_public_key(priv->keyring, pubkey, error))
+ if (!dnf_keyring_add_public_key(priv->ts, pubkey, error))
return FALSE;
}
}
@@ -1134,12 +1116,7 @@
/* setup the transaction */
tmp = dnf_context_get_install_root(priv->context);
- rc = rpmtsSetRootDir(priv->ts, tmp);
- if (rc < 0) {
- ret = FALSE;
- g_set_error_literal(error, DNF_ERROR, DNF_ERROR_INTERNAL_ERROR, _("failed to set root"));
- goto out;
- }
+ rpmtsSetRootDir(priv->ts, tmp);
rpmtsSetNotifyCallback(priv->ts, dnf_transaction_ts_progress_cb, transaction);
/* add things to install */
@@ -1471,6 +1448,5 @@
g_object_add_weak_pointer(G_OBJECT(priv->context), (void **)&priv->context);
priv->ts = rpmtsCreate();
rpmtsSetRootDir(priv->ts, dnf_context_get_install_root(context));
- priv->keyring = rpmtsGetKeyring(priv->ts, 1);
return transaction;
}
--- libdnf-0.22.0/libdnf/dnf-keyring.cpp.orig 2019-06-02 10:58:36.901502058 +0200
+++ libdnf-0.22.0/libdnf/dnf-keyring.cpp 2019-06-02 10:58:42.824527553 +0200
@@ -280,7 +280,7 @@
ret = TRUE;
out:
if (dig != NULL)
- dig = pgpDigFree(dig);
+ dig = pgpDigFree(dig, 0);
if (td != NULL) {
rpmtdFreeData(td);
free(td);
--- libdnf-0.22.0/libdnf/dnf-keyring.cpp.orig 2019-06-02 11:26:04.809681377 +0200
+++ libdnf-0.22.0/libdnf/dnf-keyring.cpp 2019-06-02 11:24:00.029136905 +0200
@@ -215,7 +215,7 @@
/* we don't want to abort on missing keys */
ts = rpmtsCreate();
- rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES);
+ rpmtsSetVSFlags(ts, (rpmVSFlags)_RPMVSF_NOSIGNATURES);
/* read in the file */
rc = rpmReadPackageFile(ts, fd, filename, &hdr);

View File

@ -1,6 +1,6 @@
Name: libdnf Name: libdnf
Version: 0.73.1 Version: 0.73.1
Release: 1mamba Release: 2mamba
Summary: Software management library Summary: Software management library
Group: System/Libraries Group: System/Libraries
Vendor: openmamba Vendor: openmamba
@ -9,13 +9,10 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/rpm-software-management/libdnf URL: https://github.com/rpm-software-management/libdnf
Source: https://github.com/rpm-software-management/libdnf.git/%{version}/libdnf-%{version}.tar.bz2 Source: https://github.com/rpm-software-management/libdnf.git/%{version}/libdnf-%{version}.tar.bz2
Patch0: libdnf-0.33.0-gcc-8.3.0.patch Patch0: libdnf-0.33.0-gcc-8.3.0.patch
Patch1: libdnf-0.22.0-rpm5.patch Patch1: libdnf-0.31.0-x86_64-disable_inferior_arch_check.patch
Patch2: libdnf-0.22.0-rpm5-2.patch Patch2: libdnf-0.60.0-openmamba-kernel-packages.patch
Patch3: libdnf-0.22.0-rpm5-additional.patch Patch3: libdnf-0.43.1-arm-detect-arch-using-uname.patch
Patch4: libdnf-0.31.0-x86_64-disable_inferior_arch_check.patch Patch4: libdnf-0.58.0-i586-default-basearch.patch
Patch5: libdnf-0.60.0-openmamba-kernel-packages.patch
Patch6: libdnf-0.43.1-arm-detect-arch-using-uname.patch
Patch7: libdnf-0.58.0-i586-default-basearch.patch
License: LGPL License: LGPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -33,10 +30,15 @@ BuildRequires: libsolv-devel
BuildRequires: libsqlite-devel BuildRequires: libsqlite-devel
BuildRequires: libstdc++6-devel BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: librpm-devel >= 4.16.1.2-1mamba
BuildRequires: libmodulemd-devel >= 2.13.0
BuildRequires: libsolv >= 0.7.5
BuildRequires: cmake BuildRequires: cmake
BuildRequires: libcppunit-devel
BuildRequires: libcheck-devel
BuildRequires: libmodulemd-devel >= 2.13.0
BuildRequires: librpm-devel >= 4.19.1.1
BuildRequires: libsolv >= 0.7.5
BuildRequires: libzck-devel
BuildRequires: python-sphinx-py3
BuildRequires: swig
Requires: libmodulemd >= 2.13.0 Requires: libmodulemd >= 2.13.0
Provides: libhawkey Provides: libhawkey
Obsoletes: libhawkey < 0.65.0 Obsoletes: libhawkey < 0.65.0
@ -59,18 +61,18 @@ This package contains libraries and header files for developing applications tha
%prep %prep
%setup -q %setup -q
#-D -T
#:<< _EOF
%patch 0 -p1 %patch 0 -p1
#%patch1 -p1
#%patch2 -p1
#%patch3 -p1
%ifarch x86_64 %ifarch x86_64
%patch 4 -p1 %patch 1 -p1
%endif %endif
%patch 5 -p1 %patch 2 -p1
%patch 6 -p1 %patch 3 -p1
%patch 7 -p1 %patch 4 -p1
%build %build
#:<< _EOF
%cmake -d build \ %cmake -d build \
-DPYTHON_DESIRED=%{__python3} -DPYTHON_DESIRED=%{__python3}
@ -78,6 +80,7 @@ This package contains libraries and header files for developing applications tha
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
export LC_ALL=en_US.UTF8
%makeinstall -C build %makeinstall -C build
%find_lang %{name} || touch %{name}.lang %find_lang %{name} || touch %{name}.lang
@ -113,6 +116,9 @@ This package contains libraries and header files for developing applications tha
%doc README.md %doc README.md
%changelog %changelog
* Mon May 13 2024 Automatic Build System <autodist@openmamba.org> 0.73.1-2mamba
- rebuilt with rpm 4.19.1.1
* Sat Mar 30 2024 Automatic Build System <autodist@openmamba.org> 0.73.1-1mamba * Sat Mar 30 2024 Automatic Build System <autodist@openmamba.org> 0.73.1-1mamba
- automatic version update by autodist - automatic version update by autodist