[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: making room



On Wed, 4 Mar 1998, Hamish Moffatt wrote:

> On Tue, Mar 03, 1998 at 05:15:18PM -0800, Jim wrote:
> > >Is there a way to check how much space a package is using? I looked
> > >for an option for the "dpkg -l", so that the size of each package
> > >would be shown, but found nothing.
> > 
> > I would _love_ an option like this!! In fact, dselect and/or deity should
> > give me a breakdown of the space that would be used by partition, of each
> > individual package and by any given group of packages.
> 
> Please bring this up on debian-policy; it was only just decided
> to remove the very information from packages that can get you this
> information easily.

I think you are mistaken.  Those du files were silly at
best.  Once we have the .list files containing md5sums and
file sizes this will be even easier, but for now, this
example script should work reasonably well:

#!/usr/bin/perl

my @list, $file, $file_size = 0, $dir_size = 0, $other_size = 0;

chomp(@list = `dpkg -L $ARGV[0]`);

while ($file = shift(@list))
{
	if (-f $file) {
		$file_size += (stat($file))[7];
	}
	elsif (-d $file) {
		$dir_size += (stat($file))[7];
	} else {
		$other_size += (stat($file))[7];
	}

}

print "bytes used by package $ARGV[0]:\n\t\tfiles $file_size bytes\n";
print "\t\tdirectories $dir_size bytes\n\t\tother $other_size bytes\n";

or anything similar.

Cheers,

-- 

"Until we extend the circle of our compassion to all living 
things, we will not ourselves find peace" -Albert Schweitzer

Richard G. Roberto


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: