[pacman-dev] [PATCH] Normalize alpm download callback function's args to frontend

ivy.foster at gmail.com ivy.foster at gmail.com
Sat Jul 9 03:11:24 UTC 2016

In response to my recent patches attempting to fix pacman's repetitive
output with --noprogressbar, agregory kindly pointed out an obvious
error I missed and suggested that I tackle the problem by making alpm's
download callback function return normalized output[1].

    [1]: https://wiki.archlinux.org/index.php/User:Apg#download_callback

I deviated only slightly from his suggested spec.
- When the total download size is unknown, return before calling the
  frontend's callback function. This is libalpm's original behavior.
- Do not attempt to report download errors. I don't see any indication in
  the curl docs that it's possible for the progress function to be called
  after a download error.
I'm happy to add either of those conditions, of course.

Oh, and agregory was quite right: a side effect of this change is that
it fixes the repeating-output bug that my previous, more complicated
patches attempted to.

As always, I welcome critiques.


More information about the pacman-dev mailing list