[devscripts] 03/03: tagpending: Only query the BTS if there are closed bugs

James McCoy jamessan at debian.org
Sat Aug 15 01:56:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 1a997e21b7f05e54a6344a6ece396939d2acd64e
Author: James McCoy <jamessan at debian.org>
Date:   Fri Aug 14 21:55:47 2015 -0400

    tagpending: Only query the BTS if there are closed bugs
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog      |  1 +
 scripts/tagpending.pl | 30 ++++++++++++++++--------------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0638dee..34657fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ devscripts (2.15.9) UNRELEASED; urgency=medium
   * tagpending:
     + Fix warning when there are no fixed bugs in the changelog.  (Closes:
       #795470)
+    + Avoid querying the BTS when there are no bugs closed in the changelog.
 
  -- Joachim Breitner <nomeata at debian.org>  Tue, 11 Aug 2015 21:12:03 +0200
 
diff --git a/scripts/tagpending.pl b/scripts/tagpending.pl
index 89897e3..cbf789a 100755
--- a/scripts/tagpending.pl
+++ b/scripts/tagpending.pl
@@ -169,25 +169,27 @@ $changes .= "   *";
 
 my $pending;
 my $open;
+my %bugs = map { $_ => 1 } @closes;
 
-if ($opt_online) {
-    if (!Devscripts::Debbugs::have_soap()) {
-	die "$progname: The libsoap-lite-perl package is required for online operation; aborting.\n";
-    }
+if (%bugs) {
+    if ($opt_online) {
+	if (!Devscripts::Debbugs::have_soap()) {
+	    die "$progname: The libsoap-lite-perl package is required for online operation; aborting.\n";
+	}
 
-    eval {
-	$pending = Devscripts::Debbugs::select( "src:$source", "status:open", "status:forwarded", "tag:pending" );
-	$open = Devscripts::Debbugs::select( "src:$source", "status:open", "status:forwarded" );
-    };
+	eval {
+	    $pending = Devscripts::Debbugs::select( "src:$source", "status:open", "status:forwarded", "tag:pending" );
+	    $open = Devscripts::Debbugs::select( "src:$source", "status:open", "status:forwarded" );
+	};
 
-    if ($@) {
-	die "$@\nUse --force to tag all bugs anyway.\n";
+	if ($@) {
+	    die "$@\nUse --force to tag all bugs anyway.\n";
+	}
     }
-}
 
-my %bugs = map { $_ => 1} @closes;
-if ($pending) {
-    %bugs = ( %bugs, map { $_ => 1} @{$pending} );
+    if ($pending) {
+	%bugs = ( %bugs, map { $_ => 1 } @{$pending} );
+    }
 }
 
 my $bug;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list