[ Petter Reinholdtsen ]
* Add more features to get_diskusage.pl, making it easier to track dependencies and rejected packages.
This commit is contained in:
parent
3bce5ff176
commit
b500a9670e
|
@ -116,6 +116,10 @@ debian-cd (2.2.25) UNRELEASED; urgency=low
|
|||
* Update popularity contest data for etch.
|
||||
* Update generate_di+k_list to include libdiscover1.
|
||||
|
||||
[ Petter Reinholdtsen ]
|
||||
* Add more features to get_diskusage.pl, making it easier to track
|
||||
dependencies and rejected packages.
|
||||
|
||||
-- Frans Pop <fjp@debian.org> Wed, 2 Aug 2006 16:47:57 +0200
|
||||
|
||||
debian-cd (2.2.24) unstable; urgency=low
|
||||
|
|
|
@ -12,7 +12,7 @@ use Text::Format; # From debian package libtext-format-perl
|
|||
use Getopt::Std;
|
||||
|
||||
my %opts;
|
||||
getopts('t', \%opts);
|
||||
getopts('cm:t', \%opts);
|
||||
|
||||
my $logfile = ($ARGV[0] ||
|
||||
"/skolelinux/developer/local0/ftp/tmp/woody-i386/log.list2cds");
|
||||
|
@ -25,6 +25,7 @@ my $text = Text::Format->new(leftMargin => 16,
|
|||
rightMargin => 0,
|
||||
firstIndent => 0);
|
||||
my $curcd = 1;
|
||||
my $markerstep = $opts{m} || 0;
|
||||
my $pkg;
|
||||
my @order;
|
||||
my %cdsize;
|
||||
|
@ -32,12 +33,35 @@ my %size;
|
|||
my %deps;
|
||||
my $curcdsize;
|
||||
my $cursize;
|
||||
my @excluded;
|
||||
my $nextmarker = $markerstep;
|
||||
while (<LOG>) {
|
||||
chomp;
|
||||
# $pkg = $1 if (/^\+ Trying to add (.+)\.\.\./);
|
||||
if (/^\+ Trying to add (.+)\.\.\./) {
|
||||
}
|
||||
if (/^ (.+) has been refused because of user choice/) {
|
||||
push @excluded, $1;
|
||||
}
|
||||
if (/^Can\'t add (.+) \.\.\. one of the package needed has been refused/) {
|
||||
my $txt = "REJECT $1 (" . join(" ", @excluded). ")";
|
||||
$size{$txt} = 0;
|
||||
$cdsize{$txt} = $curcdsize;
|
||||
push(@order, $txt);
|
||||
@excluded = ();
|
||||
}
|
||||
if (/ \$cd_size = (\d+), \$size = (\d+)/) {
|
||||
$curcdsize = $1;
|
||||
$cursize = $2;
|
||||
if ($markerstep) {
|
||||
while ($curcdsize > $nextmarker) {
|
||||
my $txt = sprintf("<=============== CD fill level passing %d KiB",
|
||||
$nextmarker / 1024);
|
||||
$size{$txt} = 0;
|
||||
$cdsize{$txt} = $curcdsize;
|
||||
push(@order, $txt);
|
||||
$nextmarker += $markerstep;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (/^ Adding (.+) to CD \d+/) {
|
||||
my ($pkg, $deplist) = split(/\s+/, $1, 2);
|
||||
|
@ -52,6 +76,7 @@ while (<LOG>) {
|
|||
$size{$txt} = 0;
|
||||
$cdsize{$txt} = 0;
|
||||
push @order, $txt;
|
||||
$nextmarker = $markerstep;
|
||||
}
|
||||
# Add delimiter
|
||||
if (/Standard system already takes (.\d+)/) {
|
||||
|
@ -63,10 +88,19 @@ while (<LOG>) {
|
|||
}
|
||||
close(LOG);
|
||||
|
||||
print " +size cdsize pkgname\n";
|
||||
if ($opts{'c'}) {
|
||||
print " +size cdsize pkgname\n";
|
||||
} else {
|
||||
print " +size pkgname\n";
|
||||
$text->leftMargin(8);
|
||||
}
|
||||
print "-----------------------\n";
|
||||
|
||||
for $pkg (@order) {
|
||||
if ($opts{'c'}) {
|
||||
printf "%7d %7d %s\n", $size{$pkg} / 1024, $cdsize{$pkg} / 1024, $pkg;
|
||||
} else {
|
||||
printf "%7d %s\n", $size{$pkg} / 1024, $pkg;
|
||||
}
|
||||
print $text->format($deps{$pkg}) if ($opts{'t'} && $deps{$pkg});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue