[Apt-listbugs-commits] [apt-listbugs] 02/02: retry one bug at a time (Closes: #493632, #524768)

Francesco Poli frx-guest at moszumanska.debian.org
Sat Mar 29 15:29:27 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 12f8da2268edb6a18692ce0c71743de175026ae0
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Thu Mar 27 00:21:39 2014 +0100

    retry one bug at a time (Closes: #493632, #524768)
---
 debian/TODO               |  1 -
 debian/changelog          |  5 +++++
 lib/apt-listbugs/logic.rb | 15 ++++++++++++---
 lib/debian/bts.rb         |  4 +++-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 57e4e55..f4ef982 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -2,7 +2,6 @@ Release goals for version 0.2.0
 -------------------------------
 * replace the old tests in tests/* with appropriate tests, maybe implemented by using autopkgtest (see http://dep.debian.net/deps/dep8/)
 * close #536613 - apt-listbugs: lists no bugs and returns 0 for non existing packages [waiting on debbugs, #553661]
-* close #493632 - apt-listbugs: should try and be more informative on "invalid date" SOAP parsing error [Merged with: 499657] [Note: is there any relation with bug #524768 ?]
 
 Release goals for version 0.3.0
 -------------------------------
diff --git a/debian/changelog b/debian/changelog
index 322f621..2d2235a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,11 @@ apt-listbugs (0.1.13) UNRELEASED; urgency=medium
     further modified by me (Closes: #441689)
   * fixed "make ParseStep configurable": created an APT configuration
     option (Closes: #562499)
+  * fixed "should try and be more informative on "invalid date" SOAP
+    parsing error" (Closes: #493632) and "Proposed Workaround for
+    Apt-listbugs SOAP Failures" (Closes: #524768): on network errors,
+    apt-listbugs now proposes to the user to retry one bug report at a
+    time and begins showing the bug number currently being parsed.
 
  -- Francesco Poli (wintermute) <invernomuto at paranoici.org>  Sat, 01 Feb 2014 15:43:19 +0100
 
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index 57e31db..e74a49c 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -838,7 +838,10 @@ module Factory
         config.frontend.puts " Exception: " + exception.class.to_s if $DEBUG
         $stderr.puts _(" E: HTTP GET failed")
         retrycount -= 1
-        retry if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+        if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+          config.parsestep = 1 if config.parsestep != 1 && config.frontend.yes_or_no?(_("One bug report at a time?"))
+          retry 
+        end
         raise _("Exiting with error") if ! config.frontend.yes_or_no?(_("Continue the installation anyway?"), false)
         bugs = []
       rescue SOAP::EmptyResponseError => exception
@@ -846,7 +849,10 @@ module Factory
         config.frontend.puts " Exception: " + exception.class.to_s if $DEBUG
         $stderr.puts _(" E: Empty stream from SOAP")
         retrycount -= 1
-        retry if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+        if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+          config.parsestep = 1 if config.parsestep != 1 && config.frontend.yes_or_no?(_("One bug report at a time?"))
+          retry 
+        end
         raise _("Exiting with error") if ! config.frontend.yes_or_no?(_("Continue the installation anyway?"), false)
         bugs = []
       rescue Exception => exception
@@ -860,7 +866,10 @@ module Factory
           config.frontend.puts _("It could be because your network is down, or because of broken proxy servers, or the BTS server itself is down. Check network configuration and try again")
         end
         retrycount -= 1
-        retry if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+        if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
+          config.parsestep = 1 if config.parsestep != 1 && config.frontend.yes_or_no?(_("One bug report at a time?"))
+          retry 
+        end
         raise _("Exiting with error") if ! config.frontend.yes_or_no?(_("Continue the installation anyway?"), false)
         bugs = []
       end
diff --git a/lib/debian/bts.rb b/lib/debian/bts.rb
index 2273d8e..36dfac5 100644
--- a/lib/debian/bts.rb
+++ b/lib/debian/bts.rb
@@ -71,7 +71,9 @@ module Debian
               soap.get_status(sa, ma_copies).each { |b| bugs << b }
               offset_i += sa.length
               sa = Debian::BTSSOAP::StringArray.new
-              yield "#{((offset_i).to_f*100/max.to_f).to_i}%"
+              pct = "#{((offset_i).to_f*100/max.to_f).to_i}%"
+              pct = "#{pct}   ##{bug}" if parsestep == 1
+              yield pct
             end
           }
           soap.get_status(sa, ma_copies).each { |b| bugs << b }

-- 
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