[pacman-dev] [PATCH] Add VerbostListInfo Option

Justin Lampley jrlampley at gmail.com
Wed Nov 14 22:44:54 EST 2007

Attached is a patch to add the VerboseListInfo option.  This option 
takes the place of ShowSize as well as ShowOldVersion, which was 
submitted as a patch but never committed. 

During searches, the size of the packages are still shown, just like 
when ShowSize was enabled.  During upgrades, the size as well as the old 
package version are shown in a formatted output with each package having 
its own line as well as each element (version, size) having its own column.

The way I decided to handle printing in this format was to create a new 
function, formatted_list_display.  This function accepts the title of 
the list, a list of rows with columns separated by commas, and a list of 
formats for the rows with the formats for each column also separated by 

Example, the rows passed to the function would look like:
lib32-gcc-libs,New,4.2.2-2,1.05 MB
audacious-player,1.3.2-4,1.4.0-1,1.07 MB

and the format would be something like:

The function splits the row up by column and prints each columns with 
the widths specified.  Since the columns are separated by commas, you 
can't have any commas in the rows or the format, so we may want to 
discuss another way to handle the formatted output.  Other than the 
possible comma problem, this function should be usable anywhere you want 
to display a table of information.

Example Output:


$ src/pacman/pacman.static -Qu
Checking for package upgrades...
warning: xpdf: forcing upgrade to version 3.02_pl2-1

Remove: lib32-gcc 

Total Removed Size:   0.00 MB


lib32-gcc-libs        New              4.2.2-2           1.05 MB
audacious-player      1.3.2-4          1.4.0-1           1.07 MB
audacious-plugins     1.3.5-5.1        1.4.0-2           1.68 MB
eclipse-pydev         1.3.9-1          1.3.10-1          3.39 MB
fakeroot              1.7.1-3          1.8.4-1           0.06 MB
glibc                 2.7-4            2.7-6            10.78 MB
glproto               1.4.8-1          1.4.9-1           0.02 MB
hal-info              0.20071011-1     0.20071030-1      0.03 MB
imagemagick         2.30 MB
lib32-glibc           2.6.1-2          2.7-5             3.64 MB
libarchive            2.2.6-2          2.4.0-1           0.32 MB
libgphoto2            2.3.1-3          2.4.0-2           1.36 MB
libmcs                0.4.1-2          0.6.0-1           0.02 MB
libsamplerate         0.1.2-3          0.1.2-4           0.20 MB
lincity-ng            1.1.1-1          1.1.2-1          29.16 MB
lm_sensors            2.10.5-1         2.10.5-2          0.32 MB
tcl                   8.4.16-1         8.4.16-2          1.63 MB
tk                    8.4.16-1         8.4.16-2          1.40 MB
ttf-dejavu            2.20-1           2.21-1            3.79 MB
xf86-video-ati        6.7.195-1        6.7.195-3         3.67 MB
xorg-server           1.4-4            1.4-5             7.25 MB
xpdf                  3.02_pl1-1       3.02_pl2-1        0.49 MB

Total Download Size:    73.64 MB
Total Installed Size:   91.08 MB


Justin Lampley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-VerboseListInfo-Option.patch
Type: text/x-patch
Size: 10325 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20071114/be03b83c/attachment.bin>

More information about the pacman-dev mailing list