Add tools/get_diskusage.pl (originally by Petter).

This commit is contained in:
Joey Hess 2004-06-29 22:02:53 +00:00
parent 351e17eb44
commit ffa69860a8
2 changed files with 38 additions and 0 deletions

1
debian/changelog vendored
View File

@ -25,6 +25,7 @@ debian-cd (2.2.18) UNRELEASED; urgency=low
- Add jfsutils to netinst cds.
- Add usbutils to netinst cds, it'll be installed by a future version
of hw-detect.
- Add tools/get_diskusage.pl (originally by Petter).
* Petter Reinholdtsen
- Regenereated tasks/popularity-contest-sarge based on the current data.
- Avoid kernel versions 2.4.24 and 2.6.3 on the first i386 CD, as we

37
tools/get_diskusage.pl Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/perl -w
#
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date: 2001-11-20
#
# Parse logfile from Debian debian-cd build, and report how much each package
# added to the CD size.
$logfile = ($ARGV[0] ||
"$ENV{TDIR}/$ENV{CODENAME}-$ENV{ARCH}/log.list2cds");
open(LOG, $logfile) || die "Unable to open $logfile";
my $pkg;
while (<LOG>) {
chomp;
$pkg = $1 if (/^\+ Trying to add (.+)\.\.\./);
if (/ \$cd_size = (\d+), \$size = (\d+)/) {
$cdsize{$pkg} = $1;
$size{$pkg} = $2;
}
last if (/Limit for CD 2 is/);
# Add delimiter
if (/Standard system already takes (.\d+)/) {
my $pkg = "<=============== end of standard pkgs";
$size{$pkg} = 0;
$cdsize{$pkg} = $1;
}
}
close(LOG);
print " +size cdsize pkgname\n";
print "-----------------------\n";
for $pkg (sort { $cdsize{$a} <=> $cdsize{$b} } keys %size) {
printf "%7d %7d %s\n", $size{$pkg} / 1024, $cdsize{$pkg} / 1024, $pkg;
}