On Wed, Mar 25, 2009 at 02:50:53PM +0100, jan damborsky wrote:

> I have taken a closer look at how long might take to obtain this
> information for one package. I have tried for package localy installed:
>
> # time pkg contents -t file -o pkg.size SUNWcsd | awk 'BEGIN {pkg_sum = 0} 
> {pkg_sum+=$1} END {print pkg_sum}'
> 24469
>
> real    0m3.707s
> user    0m2.038s
> sys     0m0.206s
>
> And when bigger one has been tried:
>
> # time pkg contents -t file -o pkg.size SUNWcs | awk 'BEGIN {pkg_sum = 0} 
> {pkg_sum+=$1} END {print pkg_sum}'
> 25309681
>
> real    0m3.820s
> user    0m2.192s
> sys     0m0.195s
>
> So it seems that size of package doesn't matter too much, the operation
> took ~3-4 seconds for one package which would mean >1/2 hour for 600
> packages if we do this on per package basis.

Why would you do it package by package?

    $ ptime pkg contents -t file -o pkg.size $(pkg list -H | nawk '{print $1}') 
> /dev/null
    real       26.080669767
    user       20.504647451
    sys         0.606594932

The only thing you're really missing is a way to list all the packages you
care about.  "pkg install" is the only thing that calculates that, but it
only spits it out when you use -v, and that's not a programmatic interface.

Danek

Reply via email to