[ 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 popularity contest data for etch.
|
||||||
* Update generate_di+k_list to include libdiscover1.
|
* 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
|
-- Frans Pop <fjp@debian.org> Wed, 2 Aug 2006 16:47:57 +0200
|
||||||
|
|
||||||
debian-cd (2.2.24) unstable; urgency=low
|
debian-cd (2.2.24) unstable; urgency=low
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Text::Format; # From debian package libtext-format-perl
|
||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
|
|
||||||
my %opts;
|
my %opts;
|
||||||
getopts('t', \%opts);
|
getopts('cm:t', \%opts);
|
||||||
|
|
||||||
my $logfile = ($ARGV[0] ||
|
my $logfile = ($ARGV[0] ||
|
||||||
"/skolelinux/developer/local0/ftp/tmp/woody-i386/log.list2cds");
|
"/skolelinux/developer/local0/ftp/tmp/woody-i386/log.list2cds");
|
||||||
|
@ -25,6 +25,7 @@ my $text = Text::Format->new(leftMargin => 16,
|
||||||
rightMargin => 0,
|
rightMargin => 0,
|
||||||
firstIndent => 0);
|
firstIndent => 0);
|
||||||
my $curcd = 1;
|
my $curcd = 1;
|
||||||
|
my $markerstep = $opts{m} || 0;
|
||||||
my $pkg;
|
my $pkg;
|
||||||
my @order;
|
my @order;
|
||||||
my %cdsize;
|
my %cdsize;
|
||||||
|
@ -32,12 +33,35 @@ my %size;
|
||||||
my %deps;
|
my %deps;
|
||||||
my $curcdsize;
|
my $curcdsize;
|
||||||
my $cursize;
|
my $cursize;
|
||||||
|
my @excluded;
|
||||||
|
my $nextmarker = $markerstep;
|
||||||
while (<LOG>) {
|
while (<LOG>) {
|
||||||
chomp;
|
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+)/) {
|
if (/ \$cd_size = (\d+), \$size = (\d+)/) {
|
||||||
$curcdsize = $1;
|
$curcdsize = $1;
|
||||||
$cursize = $2;
|
$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+/) {
|
if (/^ Adding (.+) to CD \d+/) {
|
||||||
my ($pkg, $deplist) = split(/\s+/, $1, 2);
|
my ($pkg, $deplist) = split(/\s+/, $1, 2);
|
||||||
|
@ -47,11 +71,12 @@ while (<LOG>) {
|
||||||
$deps{$pkg} = $deplist;
|
$deps{$pkg} = $deplist;
|
||||||
}
|
}
|
||||||
if (/Limit for CD (.+) is/) {
|
if (/Limit for CD (.+) is/) {
|
||||||
last if $cdlimit == $1;
|
last if $cdlimit == $1;
|
||||||
my $txt = "<=============== start of CD $1";
|
my $txt = "<=============== start of CD $1";
|
||||||
$size{$txt} = 0;
|
$size{$txt} = 0;
|
||||||
$cdsize{$txt} = 0;
|
$cdsize{$txt} = 0;
|
||||||
push @order, $txt;
|
push @order, $txt;
|
||||||
|
$nextmarker = $markerstep;
|
||||||
}
|
}
|
||||||
# Add delimiter
|
# Add delimiter
|
||||||
if (/Standard system already takes (.\d+)/) {
|
if (/Standard system already takes (.\d+)/) {
|
||||||
|
@ -63,10 +88,19 @@ while (<LOG>) {
|
||||||
}
|
}
|
||||||
close(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";
|
print "-----------------------\n";
|
||||||
|
|
||||||
for $pkg (@order) {
|
for $pkg (@order) {
|
||||||
printf "%7d %7d %s\n", $size{$pkg} / 1024, $cdsize{$pkg} / 1024, $pkg;
|
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});
|
print $text->format($deps{$pkg}) if ($opts{'t'} && $deps{$pkg});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue