From 5aea11a6718ed9caa53d1117f7a6812f2413cbf3cc0ca6bd3aa88e3209a46a9a Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 31 Mar 2019 15:09:18 +0000 Subject: [PATCH] - Upgrade to 1.9.6 + Fix progress reporting with zchunk files + Reduce download delays by using still_running correctly + Improve error handling, cleanup + Simplified lr_perform()'s loop to prevent busy wait + Require libcurl >= 7.28.0 - Drop patch included in this release * Patch: PR138-Fix-progress-reporting-with-zchunk-files.patch OBS-URL: https://build.opensuse.org/package/show/system:packagemanager:dnf/librepo?expand=0&rev=14 --- ...progress-reporting-with-zchunk-files.patch | 81 ------------------- librepo-1.9.3.tar.gz | 3 - librepo-1.9.6.tar.gz | 3 + librepo.changes | 12 +++ librepo.spec | 8 +- 5 files changed, 17 insertions(+), 90 deletions(-) delete mode 100644 PR138-Fix-progress-reporting-with-zchunk-files.patch delete mode 100644 librepo-1.9.3.tar.gz create mode 100644 librepo-1.9.6.tar.gz diff --git a/PR138-Fix-progress-reporting-with-zchunk-files.patch b/PR138-Fix-progress-reporting-with-zchunk-files.patch deleted file mode 100644 index 64b4d0c..0000000 --- a/PR138-Fix-progress-reporting-with-zchunk-files.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 746c0904d663d2bca38b9dc83708b763c333851b Mon Sep 17 00:00:00 2001 -From: Jonathan Dieter -Date: Tue, 1 Jan 2019 15:10:24 +0000 -Subject: [PATCH] Fix progress reporting with zchunk files - -Currently, when downloading a zchunk file, the progress bar gets reset to -zero when the header is finished downloading. This patch fixes that bug. - -Signed-off-by: Jonathan Dieter ---- - librepo/downloader.c | 18 ++++++++++++++++++ - librepo/downloadtarget.h | 6 ++++++ - 2 files changed, 24 insertions(+) - -diff --git a/librepo/downloader.c b/librepo/downloader.c -index 9724409..53bb5c9 100644 ---- a/librepo/downloader.c -+++ b/librepo/downloader.c -@@ -414,6 +414,13 @@ lr_progresscb(void *ptr, - if (!target->target->progresscb) - return ret; - -+#ifdef WITH_ZCHUNK -+ if (target->target->is_zchunk) { -+ total_to_download = target->target->total_to_download; -+ now_downloaded = now_downloaded + target->target->downloaded; -+ } -+#endif /* WITH_ZCHUNK */ -+ - ret = target->target->progresscb(target->target->cbdata, - total_to_download, - now_downloaded); -@@ -1106,6 +1113,7 @@ prep_zck_header(LrTarget *target, GError **err) - target->target->zck_dl = zck_dl_init(zck); - } - target->target->range = zck_get_range(0, target->target->zck_header_size-1); -+ target->target->total_to_download = target->target->zck_header_size; - target->target->resume = 0; - target->zck_state = LR_ZCK_DL_HEADER; - return lr_zck_clear_header(target, err); -@@ -1174,6 +1182,11 @@ find_local_zck_chunks(LrTarget *target, GError **err) - g_slist_free_full(filelist, free); - free(uf); - } -+ target->target->downloaded = target->target->total_to_download; -+ /* Calculate how many bytes need to be downloaded */ -+ for(zckChunk *idx = zck_get_first_chunk(zck); idx != NULL; idx = zck_get_next_chunk(idx)) -+ if(zck_get_chunk_valid(idx) != 1) -+ target->target->total_to_download += zck_get_chunk_comp_size(idx) + 92; /* Estimate of multipart overhead */ - target->zck_state = LR_ZCK_DL_BODY; - return TRUE; - } -@@ -1299,6 +1312,11 @@ check_zck(LrTarget *target, GError **err) - } - } - zck_reset_failed_chunks(zck); -+ /* Recalculate how many bytes remain to be downloaded by subtracting from total_to_download */ -+ target->target->downloaded = target->target->total_to_download; -+ for(zckChunk *idx = zck_get_first_chunk(zck); idx != NULL; idx = zck_get_next_chunk(idx)) -+ if(zck_get_chunk_valid(idx) != 1) -+ target->target->downloaded -= zck_get_chunk_comp_size(idx) + 92; - return prep_zck_body(target, err); - } - #endif /* WITH_ZCHUNK */ -diff --git a/librepo/downloadtarget.h b/librepo/downloadtarget.h -index 59bd1a8..f4c1f26 100644 ---- a/librepo/downloadtarget.h -+++ b/librepo/downloadtarget.h -@@ -152,6 +152,12 @@ typedef struct { - - gint64 zck_header_size; /*!< - Zchunk header size */ -+ -+ double total_to_download; /*!< -+ Total to download in zchunk file */ -+ -+ double downloaded; /*!< -+ Amount already downloaded in zchunk file */ - #endif /* WITH_ZCHUNK */ - - } LrDownloadTarget; diff --git a/librepo-1.9.3.tar.gz b/librepo-1.9.3.tar.gz deleted file mode 100644 index f0e15b4..0000000 --- a/librepo-1.9.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a6c9504e48e0cc591383eafecc532d7b776bdd2caaf695d23c459855d32576b6 -size 810624 diff --git a/librepo-1.9.6.tar.gz b/librepo-1.9.6.tar.gz new file mode 100644 index 0000000..da85c05 --- /dev/null +++ b/librepo-1.9.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d16ef973c29b93ea82dba1ea92d6979eed0ec322869f445acda11acfa43bba7f +size 810407 diff --git a/librepo.changes b/librepo.changes index 53b94af..7b3d7b4 100644 --- a/librepo.changes +++ b/librepo.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sun Mar 31 15:04:35 UTC 2019 - Neal Gompa + +- Upgrade to 1.9.6 + + Fix progress reporting with zchunk files + + Reduce download delays by using still_running correctly + + Improve error handling, cleanup + + Simplified lr_perform()'s loop to prevent busy wait + + Require libcurl >= 7.28.0 +- Drop patch included in this release + * Patch: PR138-Fix-progress-reporting-with-zchunk-files.patch + ------------------------------------------------------------------- Sun Feb 3 17:23:59 UTC 2019 - Neal Gompa diff --git a/librepo.spec b/librepo.spec index e867c3e..5c4c95f 100644 --- a/librepo.spec +++ b/librepo.spec @@ -29,7 +29,7 @@ %define devname %{name}-devel Name: librepo -Version: 1.9.3 +Version: 1.9.6 Release: 0 Summary: Repodata downloading library License: LGPL-2.0-or-later @@ -38,16 +38,12 @@ Group: Development/Libraries/C and C++ URL: https://github.com/rpm-software-management/librepo Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -# Patches proposed upstream -# From: https://github.com/rpm-software-management/librepo/pull/138 -Patch0101: PR138-Fix-progress-reporting-with-zchunk-files.patch - BuildRequires: cmake BuildRequires: doxygen BuildRequires: gpgme-devel BuildRequires: pkgconfig(check) BuildRequires: pkgconfig(glib-2.0) >= 2.26.0 -BuildRequires: pkgconfig(libcurl) >= 7.19.0 +BuildRequires: pkgconfig(libcurl) >= 7.28.0 BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(openssl)