• Olivier Brunel's avatar
    alpm: Fix wrong xferred/total sizes when resuming downloads · 1e3c088c
    Olivier Brunel authored and Allan McRae's avatar Allan McRae committed
    When a package is already partially downloaded in the cache, its download
    size will only be of what's left to be downloaded. Since pkg->download_size
    is what's used when calculating the total download size for the totaldl
    callback, same thing apply.
    However, the download progress callback was including this initial size,
    which would thus lead to invalid values (and percentage) used in frontends.
    That is, the progress bar could e.g. go further than 100%
    In the case of pacman, there is a sanity check for different historical
    reason (44a57c89
    ), so before the possible "overflow" was noticed, the total
    download size/progress reported was wrong. Once caught, the TotalDownload
    option was ignored and it would use individual file download values as
    fallback instead.
    Signed-off-by: default avatarOlivier Brunel <jjk@jjacky.com>
    Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>