~cjwatson/charms/quantal/wanna-build/trunk

« back to all changes in this revision

Viewing changes to generate-html

  • Committer: Colin Watson
  • Date: 2012-12-07 13:34:30 UTC
  • Revision ID: cjwatson@canonical.com-20121207133430-6zucgy14qv58nwja
generate-html: fix handling of package-versions that haven't built anywhere yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
 
116
116
my $packagecount=$buildok=$builddeps=$buildfail=0;
117
117
# parse noted logs and print into page
118
 
@packages = sort (keys %loglist);
 
118
@packages = sort (keys %wb);
119
119
 
120
120
foreach $package (@packages) {
121
 
    $logname = $loglist{$package};
 
121
    if (exists $loglist{$package}) {
 
122
        $logname = $loglist{$package};
 
123
    } else {
 
124
        $logname = undef;
 
125
    }
122
126
    $packagecount++;
123
 
    $package=$version=$arch=$date=$datestring="";
124
 
    if ($logname =~ m/$logregex/) {
125
 
        $package=$1;
126
 
        $version=$2;
127
 
        $arch=$3;
 
127
    $version = $wb{$package}[0];
 
128
    $arch = $wbarch;
 
129
    $date=$datestring="";
 
130
    if (defined $logname and $logname =~ m/$logregex/) {
128
131
        $date="$4";
129
132
        $datestring="$4 $5:$6";
130
133
    }
132
135
    $buildstate = $wb{$package}[1];
133
136
    # We don't care about this wanna-build distinction.
134
137
    $buildstate = "Built" if $buildstate eq "Installed";
135
 
    # this stuff should use internal parselog...
136
 
    $message=`$libpath/build-status-single $logpath/$logname`;
137
 
    chomp($message);
 
138
    if (defined $logname) {
 
139
        # this stuff should use internal parselog...
 
140
        $message=`$libpath/build-status-single $logpath/$logname`;
 
141
        chomp($message);
 
142
    }
138
143
    if ($buildstate eq "Built") {$buildok++} 
139
144
    elsif ($buildstate eq "BD-Uninstallable") {$builddeps++} 
140
145
    elsif ($buildstate eq "Build-Attempted") {$buildfail++}
141
 
    print $outf "<tr><td><a href=\"$logname\">$package</a></td><td>$version</td><td>$arch</td><td>".readabledate($date)."</td><td ".cellcolour($buildstate).">$buildstate</td><td>$message</td></tr>\n"; 
 
146
    if (defined $logname) {
 
147
        print $outf "<tr><td><a href=\"$logname\">$package</a></td><td>$version</td><td>$arch</td><td>".readabledate($date)."</td><td ".cellcolour($buildstate).">$buildstate</td><td>$message</td></tr>\n"; 
 
148
    } else {
 
149
        print $outf "<tr><td>$package</td><td>$version</td><td>$arch</td><td></td><td ".cellcolour($buildstate).">$buildstate</td><td></td></tr>\n"; 
 
150
    }
142
151
}
143
152
 
144
153
print $outf "</table></div>\n<a name=\"summary\"><p>Of $packagecount source packages: Build OK: $buildok, Build Failed: $buildfail, Deps failed: $builddeps</p>";