[pacman-dev] TotalDownload option.

Nathan Jones nathanj at insightbb.com
Fri Nov 9 19:54:17 EST 2007


Ok, here's the updated version:

$ sudo pacman -S gcc gcc-libs gcc-fortran
resolving dependencies... done.
looking for inter-conflicts... done.

Targets: gcc-libs-4.2.2-2 [1.06 MB]  gcc-4.2.2-3 [8.92 MB]  
         gcc-fortran-4.2.2-1 [2.91 MB]  

Total Package Size:     12.89 MB
Total Download Size:    12.89 MB

Proceed with installation? [Y/n] 
:: Retrieving packages from core...
 gcc-libs-4.2.2-2-i686   1081.1K  665.7K/s 00:00:02 [#####################]   8%
 gcc-4.2.2-3-i686          10.0M 1009.0K/s 00:00:10 [#####################]  77%
:: Retrieving packages from extra...
 gcc-fortran-4.2.2-1-...   12.9M  926.2K/s 00:00:14 [#####################] 100%
checking package integrity... done.
(3/3) checking for file conflicts                   [#####################] 100%
(1/3) upgrading gcc-libs                            [#####################] 100%
(2/3) upgrading gcc                                 [#####################] 100%
(3/3) upgrading gcc-fortran                         [#####################] 100%



I changed the download callback function to take both the current file
and the entire list xfered/totals, which gets rid of that done parameter
and cleans up the code a bit. Graphical clients could probably use both
since it's easier to draw two progress bars in a GUI.

I haven't tested this code as much as my other patch so watch out for
any bugs.




More information about the pacman-dev mailing list