On 1/3/21 3:04 am, Anatol Pomozov wrote:
Total download callback called right before packages start downloaded. But we already have an event for such event (ALPM_EVENT_PKG_RETRIEVE_START) and it is naturally to use the event to pass information about expected download size.
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> ---
Looks fine at a quick glance to me apart from small issue below. Has Andrew already reviewed this?
README | 1 - lib/libalpm/alpm.h | 32 ++++++++++++-------------------- lib/libalpm/dload.c | 2 +- lib/libalpm/handle.c | 13 ------------- lib/libalpm/handle.h | 1 - lib/libalpm/sync.c | 25 +++++++++---------------- src/pacman/callback.c | 9 ++------- src/pacman/callback.h | 2 -- src/pacman/conf.c | 4 ---- 9 files changed, 24 insertions(+), 65 deletions(-)
diff --git a/README b/README index 6aa68374..470ccf3c 100644 --- a/README +++ b/README @@ -52,7 +52,6 @@ library is initialized. * logcb: The callback function for "log" operations. * dlcb: The callback function for download progress of each package. * fetchcb: Callback for custom download function. -* totaldlcb: The callback function for overall download progress. * eventcb: Callback for transaction messages. * questioncb: Callback for selecting amongst choices. * progresscb: Callback to handle display of transaction progress. diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 230f872e..3213f5cc 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -926,6 +926,16 @@ typedef struct _alpm_event_hook_run_t { size_t total; } alpm_event_hook_run_t;
+/** An optional dependency was removed. */
Copy/paste issue.
+typedef struct _alpm_event_pkg_retrieve_t { + /** Type of event */ + alpm_event_type_t type; + /** Number of packages to download */ + size_t num; + /** Total size of packages to download */ + off_t total_size; +} alpm_event_pkg_retrieve_t; +