Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 40078 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/bin/pkg-size.orig (-4 / +8 lines)
Lines 48-59 Link Here
48
48
49
pkgname=`echo $file | sed -e "s:\/var\/db\/pkg\/::" -e "s:\/CONTENTS::"`
49
pkgname=`echo $file | sed -e "s:\/var\/db\/pkg\/::" -e "s:\/CONTENTS::"`
50
50
51
totals=`cat $file|grep "obj"|awk '{ print $2 }' | sed "s/ /\\ /" | xargs du -scb | grep total | cut -f 1`
51
contents=`cat $file|grep "obj"|awk '{ print $2 }' | sed "s/ /\\ /"`
52
52
53
size=0
53
size=0
54
for i in $totals ; do 
54
55
	size=$[size+i]
55
if [ ! -z "$contents" ] ; then
56
done
56
 totals=`echo $contents | xargs du -scb | grep total | cut -f 1`
57
 for i in $totals ; do
58
  size=$[size+i]
59
 done
60
fi
57
61
58
echo "$pkgname $size ($[size/1024]KB)"
62
echo "$pkgname $size ($[size/1024]KB)"
59
63

Return to bug 40078