~ubuntu-branches/ubuntu/karmic/sbuild/karmic-proposed

« back to all changes in this revision

Viewing changes to bin/wanna-build-statistics

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2009-05-09 16:06:44 UTC
  • mfrom: (8.1.6 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090509160644-9k0fgp6c2ajcu54h
Tags: 0.58.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - bin/sbuild, lib/Sbuild/{Base,Conf,Options}.pm: add --setup-hook
    to allow pre-build modifications to underlying chroots (needed
    to adjust pockets and components in sources.list).  (debian bug
    500746).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#######################################################################
21
21
 
22
22
use strict;
 
23
use warnings;
23
24
use vars qw($verbose $dist $database);
24
25
 
25
26
sub percent (@);
29
30
$dist = "unstable";
30
31
$database = "build-db";
31
32
 
 
33
# TODO: Use Getopt::Long.
32
34
while( @ARGV && $ARGV[0] =~ /^-/ ) {
33
35
    $_ = shift @ARGV;
34
36
    if (/^-v$/ || /^--verbose$/) {
44
46
        else {
45
47
            $dist = shift @ARGV;
46
48
        }
 
49
# TODO: Use distribution list from main configuration
47
50
        $dist = "stable"   if $dist eq "s";
48
51
        $dist = "testing"  if $dist eq "t";
49
52
        $dist = "unstable" if $dist eq "u";
50
 
        die "Bad distribution\n" if !isin($dist, qw(stable testing unstable stable-security testing-security));
 
53
        die "Bad distribution\n" if !isin($dist, qw(stable testing unstable stable-security testing-security oldstable oldstable-security));
51
54
    }
52
55
    elsif (/^--$/) {
53
56
        last;
88
91
print "--------------", "-" x length($dist), "\n";
89
92
 
90
93
my $total_width = 78;
91
 
my @state_list = qw(Installed Needs-Build Building Uploaded Failed Dep-Wait
92
 
                                        Failed-Removed Dep-Wait-Removed
93
 
                                        Not-For-Us);
 
94
 
 
95
my @state_list = qw(Installed Needs-Build Building Built
 
96
                    Build-Attempted Uploaded Failed Dep-Wait
 
97
                    Failed-Removed Dep-Wait-Removed Not-For-Us);
 
98
 
94
99
my $statewidth = 0;
95
100
grep { $statewidth = length($_) if length($_) > $statewidth } @state_list;
96
101
my $startcol = $statewidth + 9;
131
136
$total -= $n_state{"Not-For-Us"};
132
137
print percent(qw(Installed)), " up-to-date, ";
133
138
print percent(qw(Installed Uploaded)), " if also counting uploaded pkgs\n";
 
139
print percent(qw(Built Installed Uploaded)), " if also counting built pkgs\n";
134
140
print percent(qw(Needs-Build)), " uncompiled\n";
135
141
print percent(qw(Building)), " currently building (short-term delay)\n";
 
142
print percent(qw(Build-Attempted)), " currently failed building (short-term delay)\n";
136
143
print percent(qw(Failed Dep-Wait)), " failed or waiting (long-term delay)\n";
137
144
 
138
145
exit 0;