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

« back to all changes in this revision

Viewing changes to bin/sbuild-stats

  • 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:
38
38
sub align ($);
39
39
sub sortfunc ();
40
40
 
41
 
$Sbuild::Conf::cwd = "/";
 
41
my $conf = Sbuild::Conf->new();
 
42
$conf->set('CWD', '/');
42
43
 
43
44
my $db = "unspec";
44
45
my $mode = "unspec";
46
47
my $open_mode = GDBM_READER;
47
48
my $db_file = "unspec";
48
49
 
49
 
if (basename($0) =~ /avg-pkg-build-time$/) {
50
 
    $db = "time";
51
 
} elsif (basename($0) =~ /avg-pkg-build-space$/) {
52
 
    $db = "space";
53
 
}
54
 
 
55
50
GetOptions (
56
51
    "h|help" => sub { help_text("1", "sbuild-stats"); },
57
52
    "V|version" => sub {version_text("sbuild-stats"); },
65
60
or usage_error("sbuild-stats", "Error parsing command-line options");
66
61
 
67
62
if ($db eq "time") {
68
 
    $db_file = $conf::avg_time_db;
 
63
    $db_file = $conf->get('AVG_TIME_DB');
69
64
} elsif ($db eq "space") {
70
 
    $db_file = $conf::avg_space_db;
 
65
    $db_file = $conf->get('AVG_SPACE_DB');
71
66
} elsif ($db_file ne "unspec") {
72
67
# Set by hand.
73
68
} else {