[Debian-l10n-commits] r1595 - /dl10n/trunk/lib/Debian/L10n/BTS.pm
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Sun Feb 15 17:06:59 UTC 2009
Author: nekral-guest
Date: Sun Feb 15 17:06:59 2009
New Revision: 1595
URL: http://svn.debian.org/wsvn/?sc=1&rev=1595
Log:
re-indent.
Modified:
dl10n/trunk/lib/Debian/L10n/BTS.pm
Modified: dl10n/trunk/lib/Debian/L10n/BTS.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/L10n/BTS.pm?rev=1595&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/L10n/BTS.pm (original)
+++ dl10n/trunk/lib/Debian/L10n/BTS.pm Sun Feb 15 17:06:59 2009
@@ -112,97 +112,96 @@
while (@bugs_to_check) {
my $pkg = shift @bugs_to_check;
my $statusline = shift @bugs_to_check;
- my $changed = 0; # 0: No changes
- # 1: Updated
- # 2: New status added
- my ($type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb) = @{$statusline};
- my $bugwontfix = 0;
-
- # Make sure the database is written from time to time
- if ($count > 10) {
- $count = 0;
- $db->write($dbName) if defined $dbName;
- }
-
- unless ($seen{$bug_nb}) {
- my $bugdone = 0;
- my $content;
-
- my $pkg_bug = $soap_bugs->{$bug_nb}->{package};
- if ( ($pkg_bug ne $pkg)
- and ($pkg_bug ne "wnpp")) {
- warn "Warning: #$bug_nb filled against $pkg_bug but $pkg is in the database\n";
- }
- $opendate{$bug_nb} = Date::Format::time2str("%Y-%m-%d %T %z", $soap_bugs->{$bug_nb}->{date}, "GMT");
- $bugsubmitter{$bug_nb} = parse_submitter($soap_bugs->{$bug_nb}->{originator});
-
- if ( defined $soap_bugs->{$bug_nb}->{done}
- and length $soap_bugs->{$bug_nb}->{done}) {
- $bugdone = 1;
+ my $changed = 0; # 0: No changes
+ # 1: Updated
+ # 2: New status added
+ my ($type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb) = @{$statusline};
+ my $bugwontfix = 0;
+
+ # Make sure the database is written from time to time
+ if ($count > 10) {
+ $count = 0;
+ $db->write($dbName) if defined $dbName;
+ }
+
+ unless ($seen{$bug_nb}) {
+ my $bugdone = 0;
+ my $content;
+
+ my $pkg_bug = $soap_bugs->{$bug_nb}->{package};
+ if ( ($pkg_bug ne $pkg)
+ and ($pkg_bug ne "wnpp")) {
+ warn "Warning: #$bug_nb filled against $pkg_bug but $pkg is in the database\n";
+ }
+ $opendate{$bug_nb} = Date::Format::time2str("%Y-%m-%d %T %z", $soap_bugs->{$bug_nb}->{date}, "GMT");
+ $bugsubmitter{$bug_nb} = parse_submitter($soap_bugs->{$bug_nb}->{originator});
+
+ if ( defined $soap_bugs->{$bug_nb}->{done}
+ and length $soap_bugs->{$bug_nb}->{done}) {
+ $bugdone = 1;
# TODO: differentiate fixed and done ?
+ } else {
+ $bugwontfix = 1 if ($soap_bugs->{$bug_nb}->{tags} =~ m/\bwontfix\b/);
+ }
+
+ if ($bugdone) {
+ my $bts_url = "$BTS/cgi-bin/bugreport.cgi?bug=$bug_nb'}";
+ my $answer = $Web_agent -> request(HTTP::Request -> new (GET => $bts_url));
+ return 0 unless $answer -> is_success;
+ $content = $answer -> content_ref;
+ return 0 unless $$content;
+ $seen{$bug_nb} = 1;
+
+ $$content =~ /(.*?)Message #[0-9]+<\/a> received at (?:submit|maintonly)\@bugs\.debian\.org(.*)/ms;
+
+ my $v = $$content;
+ $v = $1 while ($v =~ /Message #[0-9]+<\/a> received at $bug_nb-(?:close|done)\@bugs\.debian\.org(.*)/ms);
+ $v =~ /^<b>Date:<\/b> (.*)/m;
+ $closedate{$bug_nb} = $1;
+ $closedate{$bug_nb} =
+ Debian::L10n::Utils::parse_date("Date: ".$closedate{$bug_nb} || $date);
+ }
+ }
+
+ if ($closedate{$bug_nb}) {
+ if ($closedate{$bug_nb} ne $date) {
+ $date = $closedate{$bug_nb};
+ $changed = 1 unless $changed == 2;
+ }
+ if ($status_from_db ne 'done') {
+ print "close #$bug_nb of $pkg (at $closedate{$bug_nb})\n";
+ $status_from_db = 'done';
+ $changed = 2;
+ }
} else {
- $bugwontfix = 1 if ($soap_bugs->{$bug_nb}->{tags} =~ m/\bwontfix\b/);
- }
-
- if ($bugdone) {
- my $bts_url = "$BTS/cgi-bin/bugreport.cgi?bug=$bug_nb'}";
- my $answer = $Web_agent -> request(HTTP::Request -> new (GET => $bts_url));
- return 0 unless $answer -> is_success;
- $content = $answer -> content_ref;
- return 0 unless $$content;
- $seen{$bug_nb} = 1;
-
- $$content =~ /(.*?)Message #[0-9]+<\/a> received at (?:submit|maintonly)\@bugs\.debian\.org(.*)/ms;
-
- my $v = $$content;
- $v = $1 while ($v =~ /Message #[0-9]+<\/a> received at $bug_nb-(?:close|done)\@bugs\.debian\.org(.*)/ms);
- $v =~ /^<b>Date:<\/b> (.*)/m;
- $closedate{$bug_nb} = $1;
- $closedate{$bug_nb} =
- Debian::L10n::Utils::parse_date("Date: ".$closedate{$bug_nb} || $date);
- }
- }
-
- if ($closedate{$bug_nb}) {
- if ($closedate{$bug_nb} ne $date) {
- $date = $closedate{$bug_nb};
+ if ($opendate{$bug_nb} ne $date) {
+ print "fix date of #$bug_nb of $pkg from $date to $opendate{$bug_nb}.\n";
+ $date = $opendate{$bug_nb};
+ $changed = 1 unless $changed == 2;
+ }
+ if ($bugwontfix and $status_from_db ne 'wontfix') {
+ print "wontfix #$bug_nb of $pkg\n";
+ $status_from_db = 'wontfix';
+ $changed = 2;
+ }
+ }
+ if ($bugsubmitter{$bug_nb} ne $translator) {
+ print "fix submitter of #$bug_nb of $pkg from $translator to $bugsubmitter{$bug_nb}.\n";
+ $translator = $bugsubmitter{$bug_nb};
$changed = 1 unless $changed == 2;
}
- if ($status_from_db ne 'done') {
- print "close #$bug_nb of $pkg (at $closedate{$bug_nb})\n";
- $status_from_db = 'done';
+ if ($status_from_db eq 'wontfix' and not $bugwontfix) {
+ print "removing wontfix tag for #$bug_nb of $pkg\n";
+ $status_from_db = 'bts';
$changed = 2;
}
- } else {
- if ($opendate{$bug_nb} ne $date) {
- print "fix date of #$bug_nb of $pkg from $date to $opendate{$bug_nb}.\n";
- $date = $opendate{$bug_nb};
- $changed = 1 unless $changed == 2;
- }
- if ($bugwontfix and $status_from_db ne 'wontfix') {
- print "wontfix #$bug_nb of $pkg\n";
- $status_from_db = 'wontfix';
- $changed = 2;
- }
- }
- if ($bugsubmitter{$bug_nb} ne $translator) {
- print "fix submitter of #$bug_nb of $pkg from $translator to $bugsubmitter{$bug_nb}.\n";
- $translator = $bugsubmitter{$bug_nb};
- $changed = 1 unless $changed == 2;
- }
- if ($status_from_db eq 'wontfix' and not $bugwontfix) {
- print "removing wontfix tag for #$bug_nb of $pkg\n";
- $status_from_db = 'bts';
- $changed = 2;
- }
-
- if ($changed == 2) {
- $db->add_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
- } elsif ($changed == 1) {
- $db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb, $statusline);
- }
- }
-
+
+ if ($changed == 2) {
+ $db->add_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb);
+ } elsif ($changed == 1) {
+ $db->set_status($pkg, $type, $file, $date, $status_from_db, $translator, $list, $url, $bug_nb, $statusline);
+ }
+ }
}
=head1 LICENSE
More information about the Debian-l10n-commits
mailing list