Update to 0.28.0

This commit is contained in:
Pavla Kratochvilova 2019-03-12 10:59:50 +01:00
parent cca5ea360d
commit 44bae0b80b
5 changed files with 14 additions and 130 deletions

1
.gitignore vendored
View File

@ -30,3 +30,4 @@
/libdnf-0.22.3.tar.gz /libdnf-0.22.3.tar.gz
/libdnf-0.24.1.tar.gz /libdnf-0.24.1.tar.gz
/libdnf-0.26.0.tar.gz /libdnf-0.26.0.tar.gz
/libdnf-0.28.0.tar.gz

View File

@ -1,34 +0,0 @@
From d696a96249a7bf2e71977594a278a86b06e50cb6 Mon Sep 17 00:00:00 2001
From: Jonathan Dieter <jdieter@gmail.com>
Date: Sat, 22 Dec 2018 16:56:59 +0000
Subject: [PATCH] Zchunk configuration flags were backwards, so setting zchunk=false would
---
libdnf/repo/Repo.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp
index 42823e7..7c0e464 100644
--- a/libdnf/repo/Repo.cpp
+++ b/libdnf/repo/Repo.cpp
@@ -575,7 +575,7 @@ std::unique_ptr<LrHandle> Repo::Impl::lrHandleInitLocal()
handleSetOpt(h.get(), LRO_LOCAL, 1L);
#ifdef LRO_SUPPORTS_CACHEDIR
/* If zchunk is enabled, set librepo cache dir */
- if (!conf->getMasterConfig().zchunk().getValue())
+ if (conf->getMasterConfig().zchunk().getValue())
handleSetOpt(h.get(), LRO_CACHEDIR, conf->basecachedir().getValue().c_str());
#endif
return h;
@@ -662,7 +662,7 @@ std::unique_ptr<LrHandle> Repo::Impl::lrHandleInitRemote(const char *destdir, bo
#ifdef LRO_SUPPORTS_CACHEDIR
/* If zchunk is enabled, set librepo cache dir */
- if (!conf->getMasterConfig().zchunk().getValue())
+ if (conf->getMasterConfig().zchunk().getValue())
handleSetOpt(h.get(), LRO_CACHEDIR, conf->basecachedir().getValue().c_str());
#endif
--
libgit2 0.27.7

View File

@ -1,90 +0,0 @@
From d5e661a8eae27fb6108f54d924ac0af709696c60 Mon Sep 17 00:00:00 2001
From: Jonathan Dieter <jdieter@gmail.com>
Date: Sat, 22 Dec 2018 17:01:13 +0000
Subject: [PATCH] hy_repos weren't being filled properly when using zchunk metadata, so this
---
libdnf/dnf-repo.cpp | 35 +++++++++++++++++++++++++++--------
libdnf/repo/Repo.cpp | 17 ++++++++++++++++-
2 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/libdnf/dnf-repo.cpp b/libdnf/dnf-repo.cpp
index 1cf762b..3357af2 100644
--- a/libdnf/dnf-repo.cpp
+++ b/libdnf/dnf-repo.cpp
@@ -1439,14 +1439,33 @@ dnf_repo_check_internal(DnfRepo *repo,
hy_repo_free(priv->repo);
priv->repo = hy_repo_create(priv->id);
hy_repo_set_string(priv->repo, HY_REPO_MD_FN, yum_repo->repomd);
- tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "primary"));
- hy_repo_set_string(priv->repo, HY_REPO_PRIMARY_FN, tmp);
- tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "filelists"));
- hy_repo_set_string(priv->repo, HY_REPO_FILELISTS_FN, tmp);
- tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "updateinfo"));
- hy_repo_set_string(priv->repo, HY_REPO_UPDATEINFO_FN, tmp);
- tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "modules"));
- hy_repo_set_string(priv->repo, MODULES_FN, tmp);
+ if (dnf_context_get_zchunk(priv->context)) {
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "primary_zck"));
+ if(!tmp)
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "primary"));
+ hy_repo_set_string(priv->repo, HY_REPO_PRIMARY_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "filelists_zck"));
+ if(!tmp)
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "filelists"));
+ hy_repo_set_string(priv->repo, HY_REPO_FILELISTS_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "updateinfo_zck"));
+ if(!tmp)
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "updateinfo"));
+ hy_repo_set_string(priv->repo, HY_REPO_UPDATEINFO_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "modules_zck"));
+ if(!tmp)
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "modules"));
+ hy_repo_set_string(priv->repo, MODULES_FN, tmp);
+ } else {
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "primary"));
+ hy_repo_set_string(priv->repo, HY_REPO_PRIMARY_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "filelists"));
+ hy_repo_set_string(priv->repo, HY_REPO_FILELISTS_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "updateinfo"));
+ hy_repo_set_string(priv->repo, HY_REPO_UPDATEINFO_FN, tmp);
+ tmp = static_cast<const gchar *>(g_hash_table_lookup(priv->filenames_md, "modules"));
+ hy_repo_set_string(priv->repo, MODULES_FN, tmp);
+ }
/* ensure we reset the values from the keyfile */
if (!dnf_repo_set_keyfile_data(repo, error))
diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp
index 7c0e464..98279e6 100644
--- a/libdnf/repo/Repo.cpp
+++ b/libdnf/repo/Repo.cpp
@@ -275,10 +275,25 @@ private:
delete[] *item;
delete[] ptr;
}};
+ bool endsWith(std::string const &str, std::string const &ending) const;
};
+bool Repo::Impl::endsWith(const std::string &str, const std::string &ending) const {
+ if (str.length() >= ending.length())
+ return (str.compare(str.length() - ending.length(), ending.length(), ending) == 0);
+ else
+ return false;
+}
+
std::string Repo::Impl::getMetadataPath(const std::string &metadataType) const {
- auto it = metadataPaths.find(metadataType);
+ std::string lookupMetadataType = metadataType;
+ if (conf->getMasterConfig().zchunk().getValue()) {
+ if(!endsWith(metadataType, "_zck"))
+ lookupMetadataType = metadataType + "_zck";
+ }
+ auto it = metadataPaths.find(lookupMetadataType);
+ if(it == metadataPaths.end() && lookupMetadataType != metadataType)
+ it = metadataPaths.find(metadataType);
return (it != metadataPaths.end()) ? it->second : "";
}
--
libgit2 0.27.7

View File

@ -1,5 +1,6 @@
%global libsolv_version 0.6.35-1 %global libsolv_version 0.6.35-1
%global libmodulemd_version 1.6.1 %global libmodulemd_version 1.6.1
%global librepo_version 1.9.5
%global dnf_conflict 4.1.0 %global dnf_conflict 4.1.0
%global swig_version 3.0.12 %global swig_version 3.0.12
@ -30,21 +31,19 @@
%{nil} %{nil}
Name: libdnf Name: libdnf
Version: 0.26.0 Version: 0.28.0
Release: 2%{?dist} Release: 1%{?dist}
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
Patch0001: 0001-Revert-9309e92332241ff1113433057c969cebf127734e.patch Patch0001: 0001-Revert-9309e92332241ff1113433057c969cebf127734e.patch
Patch0002: 0002-Zchunk-configuration-flags-were-backwards-so-setting-zchunkfalse-would.patch
Patch0003: 0003-hy_repos-werent-being-filled-properly-when-using-zchunk-metadata-so-this.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libsolv-devel >= %{libsolv_version} BuildRequires: libsolv-devel >= %{libsolv_version}
BuildRequires: pkgconfig(librepo) BuildRequires: pkgconfig(librepo) >= %{librepo_version}
BuildRequires: pkgconfig(check) BuildRequires: pkgconfig(check)
%if %{with valgrind} %if %{with valgrind}
BuildRequires: valgrind BuildRequires: valgrind
@ -66,6 +65,7 @@ BuildRequires: gpgme-devel
Requires: libmodulemd%{?_isa} >= %{libmodulemd_version} Requires: libmodulemd%{?_isa} >= %{libmodulemd_version}
Requires: libsolv%{?_isa} >= %{libsolv_version} Requires: libsolv%{?_isa} >= %{libsolv_version}
Requires: librepo%{?_isa} >= %{librepo_version}
%description %description
A Library providing simplified C and Python API to libsolv. A Library providing simplified C and Python API to libsolv.
@ -248,6 +248,13 @@ popd
%endif %endif
%changelog %changelog
* Mon Mar 11 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.28.0-1
- Update to 0.28.0
- Exclude module pkgs that have conflict
- Enhance config parser to preserve order of data, and keep comments and format
- Improve ARM detection
- Add support for SHA-384
* Tue Feb 19 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.26.0-2 * Tue Feb 19 2019 Jaroslav Mracek <jmracek@redhat.com> - 0.26.0-2
- Backport patches for zchunk - Backport patches for zchunk

View File

@ -1 +1 @@
SHA512 (libdnf-0.26.0.tar.gz) = 62bfebf5b7c09a98cab957ee90da07a0a67d371449752af8e3f07e1f54d766fa1284f891f666f7de2dbca42670e116b3df30a514d74f84f5300db9e87cb3b91f SHA512 (libdnf-0.28.0.tar.gz) = 518372705228a09461b1014dc5990c301991996d1c5e5eac0ff5c67601cb23febf45e10673f06a0e31bb9b8d4f76b1f59bfcccf9dcfb23013d41fd1e208757a9