[lintian] 01/03: c/reporting-*: Use compontent instead of area
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch reporting-rewrite-config-and-archive-handling
in repository lintian.
commit 41d954e8c1359bd4ea9351c2bd55337677cb6434
Author: Niels Thykier <niels@thykier.net>
Date: Fri Apr 28 18:31:42 2017 +0000
c/reporting-*: Use compontent instead of area
Use "component" instead of "area" in the code to match the name used
on the frontpage of the reports.
Signed-off-by: Niels Thykier <niels@thykier.net>
---
commands/reporting-html-reports.pm | 14 ++++++-------
commands/reporting-sync-state.pm | 42 +++++++++++++++++++++++++------------
reporting/templates/maintainer.tmpl | 10 ++++-----
3 files changed, 41 insertions(+), 25 deletions(-)
diff --git a/commands/reporting-html-reports.pm b/commands/reporting-html-reports.pm
index a8967d2..5b9833e 100644
--- a/commands/reporting-html-reports.pm
+++ b/commands/reporting-html-reports.pm
@@ -101,7 +101,7 @@ my (%statistics, %tag_statistics);
# pkg_info => {
# package => 'gnubg',
# version => '0.15~20061120-1',
-# area => 'main',
+# component => 'main',
# type => 'source',
# anchor => 'gnubg_0.15~20061120-1',
# xref => 'rra@debian.org.html#gnubg_0.15~20061120-1'
@@ -854,10 +854,10 @@ sub parse_lintian_log {
# Determine the source package for this package and warn if
# there appears to be no source package in the archive.
- # Determine the maintainer, version, and archive area. Work
+ # Determine the maintainer, version, and archive component. Work
# around a missing source package by pulling information from
# a binary package or udeb of the same name if there is any.
- my ($source, $area, $source_version, $maintainer, $uploaders);
+ my ($source, $component, $source_version, $maintainer, $uploaders);
my $member_id
= "${type}:${package}/${version}"
. ($type ne 'source' ? "/$arch" : q{});
@@ -881,7 +881,7 @@ sub parse_lintian_log {
$unknown_member_id{$member_id} = 1;
}
$state_data //= {};
- $area = $state_data->{'mirror-metadata'}{'area'} ||= 'main';
+ $component = $state_data->{'mirror-metadata'}{'component'} ||= 'main';
$maintainer = $state_data->{'mirror-metadata'}{'maintainer'}
||= '(unknown)';
$uploaders = $state_data->{'mirror-metadata'}{'uploaders'};
@@ -974,7 +974,7 @@ sub parse_lintian_log {
# There is a check for type being in a fixed whitelist of
# HTML-safe keywords in the start of the loop.,
type => $type,
- area => html_quote($area),
+ component => html_quote($component),
# should be safe
anchor => $anchor,
xref => maintainer_url($maintainer). "#${anchor}",
@@ -1099,7 +1099,7 @@ sub output_template {
return;
}
-# Sort function for sorting lists of tags. Sort by package, version, area,
+# Sort function for sorting lists of tags. Sort by package, version, component,
# type, tag, and then any extra data. This will produce the best HTML output.
#
# Note that source tags must come before all other tags, hence the "unfair"
@@ -1115,7 +1115,7 @@ sub by_tag {
return
$a_pi->{package} cmp $b_pi->{package}
|| $a_pi->{version} cmp $b_pi->{version}
- || $a_pi->{area} cmp $b_pi->{area}
+ || $a_pi->{component} cmp $b_pi->{component}
|| $a_pi->{type} cmp $b_pi->{type}
|| $a->{tag_info}->tag cmp $b->{tag_info}->tag
|| $a->{extra} cmp $b->{extra};
diff --git a/commands/reporting-sync-state.pm b/commands/reporting-sync-state.pm
index 568b5a4..1e8bedb 100644
--- a/commands/reporting-sync-state.pm
+++ b/commands/reporting-sync-state.pm
@@ -139,7 +139,22 @@ sub main {
sub upgrade_state_cache_if_needed {
my ($state) = @_;
- return 0 if exists($state->{'groups'});
+ if (exists($state->{'groups'})) {
+ my $updated = 0;
+ my $groups = $state->{'groups'};
+ for my $group (sort(keys(%{$groups}))) {
+ my $group_data = $groups->{$group};
+ if ( exists($group_data->{'mirror-metadata'})
+ && exists($group_data->{'mirror-metadata'}{'area'})) {
+ if (not exists($group_data->{'mirror-metadata'}{'component'})){
+ $group_data->{'mirror-metadata'}{'component'}
+ = $group_data->{'mirror-metadata'}{'area'};
+ $updated = 1;
+ }
+ }
+ }
+ return $updated;
+ }
# Migrate the "last-processed-by" version.
my $groups = $state->{'groups'} = {};
for my $key (sort(keys(%${state}))) {
@@ -269,7 +284,7 @@ sub cleanup_group_state {
my $member_data = $members->{$member_id};
# Create "member_id to group_data" link
$state->{'members-to-groups'}{$member_id} = $group_data;
- delete($member_data->{'mirror-metadata'}{'area'})
+ delete($member_data->{'mirror-metadata'}{'component'})
if exists($member_data->{'mirror-metadata'});
remove_if_empty($member_data, 'mirror-metadata');
}
@@ -293,7 +308,7 @@ sub cleanup_group_state {
} else {
# remove redundant fields
remove_if_empty($group_data, 'out-of-date');
- for my $metadata_field (qw(area maintainer uploaders)) {
+ for my $metadata_field (qw(component maintainer uploaders)) {
remove_if_empty($group_data->{'mirror-metadata'}, $metadata_field);
}
remove_if_empty($group_data, 'mirror-metadata');
@@ -325,7 +340,7 @@ sub _parse_srcs_pg {
}
$group_mirror_md = $group_metadata{'mirror-metadata'};
- $group_mirror_md->{'area'} = $extra_metadata->{'area'};
+ $group_mirror_md->{'component'} = $extra_metadata->{'component'};
$group_mirror_md->{'maintainer'} = $paragraph->{'maintainer'};
if (my $uploaders = $paragraph->{'uploaders'}) {
my @ulist = split(/>\K\s*,\s*/, $uploaders);
@@ -371,7 +386,7 @@ sub _parse_pkgs_pg {
return;
}
-# local_mirror_manifests ($mirdir, $dists, $areas, $archs)
+# local_mirror_manifests ($mirdir, $dists, $components, $archs)
#
# Returns a list of manifests that represents what is on the local mirror
# at $mirdir. 3 manifests will be returned, one for "source", one for "binary"
@@ -380,26 +395,27 @@ sub _parse_pkgs_pg {
#
# $mirdir - the path to the local mirror
# $dists - listref of dists to consider (e.g. ['unstable'])
-# $areas - listref of areas to consider (e.g. ['main', 'contrib', 'non-free'])
+# $components - listref of components to consider (e.g. ['main', 'contrib', 'non-free'])
# $archs - listref of archs to consider (e.g. ['i386', 'amd64'])
#
sub local_mirror_manifests {
- my ($state, $mirdir, $dists, $areas, $archs) = @_;
+ my ($state, $mirdir, $dists, $components, $archs) = @_;
foreach my $dist (@$dists) {
- foreach my $area (@$areas) {
- my $srcs = "$mirdir/dists/$dist/$area/source/Sources";
+ foreach my $component (@{$components}) {
+ my $srcs = "$mirdir/dists/$dist/$component/source/Sources";
my ($srcfd, $srcsub);
my %extra_metadata = (
- 'area' => $area,
+ 'component' => $component,
'mirror-dir' => $mirdir,
);
# Binaries have a "per arch" file.
# - we check those first and then include the source packages that
# are referred to by these binaries.
+ my $dist_path = "$mirdir/dists/$dist/$component";
foreach my $arch (@{$archs}) {
- my $pkgs = "$mirdir/dists/$dist/$area/binary-$arch/Packages";
- my $upkgs = "$mirdir/dists/$dist/$area/debian-installer/"
- ."binary-$arch/Packages";
+ my $pkgs = "${dist_path}/binary-$arch/Packages";
+ my $upkgs
+ = "${dist_path}/debian-installer/binary-$arch/Packages";
my $pkgfd = _open_data_file($pkgs);
my $binsub = sub {
_parse_pkgs_pg($state, \%extra_metadata, 'binary', @_);
diff --git a/reporting/templates/maintainer.tmpl b/reporting/templates/maintainer.tmpl
index 209cd63..b547df1 100644
--- a/reporting/templates/maintainer.tmpl
+++ b/reporting/templates/maintainer.tmpl
@@ -99,8 +99,8 @@
my $tag_info = $info->{tag_info};
my $next_tag = $tag_info->tag;
- my $area = ($pkg_info->{area} eq 'main') ? '' : "; $pkg_info->{area}";
- $firstarea = $pkg_info->{area} unless $firstarea;
+ my $component = ($pkg_info->{component} eq 'main') ? '' : "; $pkg_info->{component}";
+ $firstcomponent = $pkg_info->{component} unless $firstcomponent;
if ($first) {
my $state = $pkg_info->{'state_data'};
my $status = 'up-to-date';
@@ -108,7 +108,7 @@
$status = '<i>outdated</i>' if (exists($state->{'out-of-date'}));
$OUT .= qq( <div class="source-header">\n);
$OUT .= qq( <h2 id="$pkg_info->{anchor}">);
- $OUT .= "$source ($version$area)";
+ $OUT .= "$source ($version$component)";
$OUT .= " [Uploader]" if $upload;
if ($first_version) {
# Unversioned #<pkg> references just go to the first version.
@@ -127,8 +127,8 @@
my $bin_version = '';
unless ($pkg_info->{version} eq $version
- and $pkg_info->{area} eq $firstarea) {
- $bin_version = " ($pkg_info->{version}; $pkg_info->{area})";
+ and $pkg_info->{component} eq $firstcomponent) {
+ $bin_version = " ($pkg_info->{version}; $pkg_info->{component})";
}
if ($tag ne $next_tag or $new_binary) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: