Hi Brock,
Yes, pkg info can get some input, but is difficult to parse it with one
liners and there is missing important stiff for me, like compressed size.
For OS size optimizations I need to be able to answer question like this:
Q: What is the most top 100 installed packages by size or csize ?
Main ONE Liner (I was not able to use pkg.csize, so I need to parse RAW
??? )
pkg contents -t file -o "pkg.name,action.raw" SUNWevolution | sed -e
"s/=/ /g" | awk '{ FIRST = $1; CSUM += $15; SUM += $17} END { printf
"%10d %10d %26s\n", SUM,CSUM,FIRST }'
11888619 6184852 SUNWevolution
Getting all sizes for installed packages:
cat >/tmp/sizes.bash
#!/usr/bin/bash
pkg contents -t file -o "pkg.name,action.raw" $1 | sed -e "s/=/ /g" |
awk '{ FIRST = $1; CSUM += $15; SUM += $17} END { printf "%10d %10d
%26s\n", SUM,CSUM,FIRST }'
^C
chmod 0777 /tmp/sizes.bash
pkg list | awk '{print $1}' | grep -v "NAME" | xargs -n 1
/tmp/sizes.bash >/tmp/allsizes.lst
After while, do:
cat /tmp/allsizes.lst | sort -n -r | head -n 100
116345022 39834497 SUNWgnome-l10nmessages-extra
68165849 24774784 SUNWj6rt
51823595 39857154 FSWxorg-fonts
45274038 24230019 SUNWgnome-themes
33040328 5923024 SUNWgnome-base-libs
...
31034165 8442789 SUNWfirefox
...
12796243 2744137 SUNWthunderbirdl10n-extra
11888619 6184852 SUNWevolution
...
10788307 2812225 SUNWthunderbird
Nice day
Rudolf Kutina
Brock Pytlik wrote:
> It's possible that pkg info SUNWevolution will provide what you're
> looking for.
>
> Brock
>
> Rudolf Kutina wrote:
>> Hi All,
>>
>> Is there a elegant way how to find whole package size ?
>>
>> For both installed package and packages in repo ?
>>
>> I use in 200895 this procedure:
>>
>> pkg contents -t file -o pkg.name,pkg.size,desc SUNWevolution | awk '{
>> FIRST = $1; SUM += $2; THIRD = $3} END { printf "%12s %10.1f
>> %s\n",FIRST, SUM/1024/1024,THIRD }'
>> SUNWevolution 17.5
>>
>> However I was not able to get long description of package ?
>>
>> Nice day
>> Rudolf Kutina
>> _______________________________________________
>> pkg-discuss mailing list
>> [email protected]
>> http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
>>
>
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss