[Apt-listbugs-commits] [apt-listbugs] 01/01: comment manually ignored bugs (Closes: #484423)

Francesco Poli frx-guest at moszumanska.debian.org
Sat Jul 5 17:13:00 UTC 2014


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

frx-guest pushed a commit to branch master
in repository apt-listbugs.

commit c663d60a3ea25e6990e33897e20dde42d3c1784a
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Sat Jul 5 19:05:10 2014 +0200

    comment manually ignored bugs (Closes: #484423)
---
 debian/TODO               |  1 -
 debian/changelog          |  3 +++
 lib/apt-listbugs/logic.rb |  2 ++
 lib/debian/bts.rb         | 11 +++++++++++
 lib/debian/btssoap.rb     | 17 +++++++++++++----
 5 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 0b0c57a..51d1b9e 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -7,5 +7,4 @@ Release goals for version 0.3.0
 -------------------------------
 * close #532678 - apt-listbugs: faster method to select bugs
 * close #257873 - apt-listbugs: gets confused about version tracking when source version differs from binary version [waiting on debbugs, #694979]
-* close #484423 - manually ignored bugs should have a comment, too
 
diff --git a/debian/changelog b/debian/changelog
index 2af8f51..da53c7d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,9 @@ apt-listbugs (0.1.14) UNRELEASED; urgency=medium
      - clarified one debug message
      - internationalized non-debug messages 
   * improved detection of previous pins when pinning buggy packages
+  * fixed "manually ignored bugs should have a comment, too": a comment line
+    is now added in a way similar to the line added for automatically ignored
+    bugs (Closes: #484423)
 
  -- Francesco Poli (wintermute) <invernomuto at paranoici.org>  Sun, 11 May 2014 16:45:18 +0200
 
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index 64bc7a5..1ce77d8 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -444,6 +444,8 @@ class Viewer
 
         when /^i\s+(\d+)$/
           if ! @config.system_ignore_bugs.include?($1)
+            bug = @config.parser.parse_bug($1)
+            @config.system_ignore_bugs.add(bug)
             @config.system_ignore_bugs.add($1)
             Factory::BugsFactory.delete_ignore_bugs(bugs)
             @config.frontend.puts sprintf(_("%s ignored"), $1)
diff --git a/lib/debian/bts.rb b/lib/debian/bts.rb
index 36dfac5..1dcd4b8 100644
--- a/lib/debian/bts.rb
+++ b/lib/debian/bts.rb
@@ -45,6 +45,17 @@ module Debian
           @buf = nil
         end
 
+        def parse_bug(bugnum)
+          require 'debian/btssoap'
+          soap = Debian::BTSSOAP::Soap.new(@host, @port)
+          sa = Debian::BTSSOAP::StringArray.new
+
+          # query the BTS about the given bug number
+          sa << bugnum
+          bugs = soap.get_status(sa)
+          bugs.fetch(0, "# ???")
+        end
+
         def parse(ma_copies, parsestep, severities = ["critical", "grave"])
           require 'debian/btssoap'
           soap = Debian::BTSSOAP::Soap.new(@host, @port)
diff --git a/lib/debian/btssoap.rb b/lib/debian/btssoap.rb
index 8b7e78f..d4a39c1 100644
--- a/lib/debian/btssoap.rb
+++ b/lib/debian/btssoap.rb
@@ -1,6 +1,6 @@
 # btssoap.rb - ruby interface for Debian BTS SOAP engine
 # Copyright (C) 2006-2008  Junichi Uekawa <dancer at debian.org>
-# Copyright (C) 2009-2013  Francesco Poli <invernomuto at paranoici.org>
+# Copyright (C) 2009-2014  Francesco Poli <invernomuto at paranoici.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -49,7 +49,7 @@ module Debian
         @drv.get_bugs(param)
       end
 
-      def get_status(sa, ma_copies)
+      def get_status(sa, ma_copies = nil)
         ### soap interface to get bug status matching the bug number(s). sa is an array of strings. ma_copies is the multiarch map.
         get_status = Debian::Bugs.new
         if sa.size == 0
@@ -60,8 +60,17 @@ module Debian
           @drv.get_status(sa).each { |bugnum, res|
             # parse the received information, given from the server
             p res if $DEBUG
-            res.package.split(/[ \t?,()]+/).each { |pkg_name|
-              keys = ma_copies[pkg_name]
+            if ma_copies.nil?
+              packages = [res.package]
+            else
+              packages = res.package.split(/[ \t?,()]+/)
+            end
+            packages.each { |pkg_name|
+              if ma_copies.nil?
+                keys = [pkg_name]
+              else
+                keys = ma_copies[pkg_name]
+              end
               if ( keys != nil )
                 keys.each { |pkg_key|
                   newbug = Debian::Bug.new(pkg_key,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/apt-listbugs/apt-listbugs.git



More information about the Apt-listbugs-commits mailing list