You are not logged in.

#1 2012-03-07 14:26:59

anix
Member
From: China
Registered: 2011-03-17
Posts: 6

[Solved]how to query packages size to be downloaded?

Hi :
I am working on a script to optimize my pkgs download speed and I need to know the size of each package to be downloaded.I've read `man pacman` and  /var/lib/pacman/local/* and no clue found.

#+begin_src bash
sudo pacman -Su
blahblah
Total Download Size:    93.28 MiB # How? I need to know the size of *each* package not *Total*
Total Installed Size:   325.88 MiB
Net Upgrade Size:       1.29 MiB
#+end_src

Last edited by anix (2012-03-07 15:00:15)


/arch/gentoo/openbsd/

Offline

#2 2012-03-07 14:38:42

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved]how to query packages size to be downloaded?

The only way I know would be to

$ pacman -Sup --print-format %n
...
tzdata
glibc
dnsmasq
gcc-libs
ppl
gcc
git
...

and parse the output to separate each package, then run each package through pacman -Si and parse that for the package size:

$ pacman -Si dnsmasq
...
Download Size  : 170.40 KiB
...

Last edited by alphaniner (2012-03-07 14:41:21)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-03-07 14:38:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]how to query packages size to be downloaded?

Not sure if this is what you want, but put (or uncomment) 'VerbosePkgLists' in your pacman.conf.

Targets (3):

Name                  Old Version  New Version  Net Change  Download Size

git                   1.7.9.2-1    1.7.9.3-1    0,01 MiB         2,43 MiB
libxmu                1.1.0-2      1.1.1-1      -0,05 MiB        0,07 MiB
xorg-fonts-encodings  1.0.4-2      1.0.4-3      0,00 MiB         0,54 MiB

Total Download Size:    3,03 MiB
Total Installed Size:   16,70 MiB
Net Upgrade Size:       -0,05 MiB

Last edited by karol (2012-03-07 14:39:40)

Offline

#4 2012-03-07 14:44:25

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved]how to query packages size to be downloaded?

alphaniner wrote:

The only way I know would be to

$ pacman -Sup --print-format %n
...
tzdata
glibc
dnsmasq
gcc-libs
ppl
gcc
git
...

and parse the output to separate each package, then run each package through pacman -Si and parse that for the package size:

$ pacman -Si dnsmasq
...
Download Size  : 170.40 KiB
...

Except, the manpage would have told you that the %s token does exactly this already...

$ pacman -Qqu | pacman -Sp --print-format '%n %s' -
indent 106048
jre7-openjdk-headless 21809448
jre7-openjdk 179416
jdk7-openjdk 10247484
syslinux 813128

I'm avoiding using -Sup as it prints an annoying ':: Starting full system upgrade...' as the first line.

Offline

#5 2012-03-07 14:52:01

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved]how to query packages size to be downloaded?

Thanks, I hadn't yet gotten my %DV of attitude today.

Edit: Can't even quip properly, lol.

Last edited by alphaniner (2012-03-07 15:06:31)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2012-03-07 14:56:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved]how to query packages size to be downloaded?

anix wrote:

I've read `man pacman`

You should have read 'man pacman.conf' too:

VerbosePkgLists
           Displays name, version and size of target packages formatted as a
           table for upgrade, sync and remove operations.

+ what falconindy posted.

Offline

#7 2012-03-07 15:06:43

anix
Member
From: China
Registered: 2011-03-17
Posts: 6

Re: [Solved]how to query packages size to be downloaded?

thanks.
both "uncomment 'VerbosePkgLists' in  pacman.conf" and "pacman -Qqu | pacman -Sp --print-format '%n %s' -" works~


/arch/gentoo/openbsd/

Offline

Board footer

Powered by FluxBB