[Apt-listbugs-commits] [apt-listbugs] 02/02: implement option --force-no-pin (Closes: #828108)

Francesco Poli frx-guest at moszumanska.debian.org
Sat Jun 25 16:46:04 UTC 2016


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 9cda23467cbb6a727c891d2fc2dcace1a486f01a
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Sat Jun 25 18:43:17 2016 +0200

    implement option --force-no-pin (Closes: #828108)
---
 bin/apt-listbugs         |  9 +++++++--
 debian/changelog         |  2 ++
 lib/aptlistbugs/logic.rb | 10 ++++++++--
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/bin/apt-listbugs b/bin/apt-listbugs
index a846b7b..c0b0532 100755
--- a/bin/apt-listbugs
+++ b/bin/apt-listbugs
@@ -46,7 +46,7 @@ installation/upgrade is safe.
 
 == USAGE
 
-apt-listbugs [-h] [-v] [-s <severities>] [-T <tags>] [-S <states>] [-B <bug#>] [-D] [-H <hostname>] [-p <port>] [-P <priority>] [-E <title>] [-q] [-C <apt.conf>] [-F] [-y] [-n] [-d] <command> [arguments]
+apt-listbugs [-h] [-v] [-s <severities>] [-T <tags>] [-S <states>] [-B <bug#>] [-D] [-H <hostname>] [-p <port>] [-P <priority>] [-E <title>] [-q] [-C <apt.conf>] [-F] [-N] [-y] [-n] [-d] <command> [arguments]
 
 == OPTIONS
 
@@ -134,7 +134,12 @@ apt-listbugs [-h] [-v] [-s <severities>] [-T <tags>] [-S <states>] [-B <bug#>] [
 
   When in apt mode, assumes that you want to automatically pin all buggy
   packages without any prompt.  This option is assumed if stdout is not a
-  terminal.
+  terminal, unless the "-N" command-line option is used.
+
+* -N, --force-no-pin
+
+  When in apt mode, never automatically pin any package without prompt.
+  This is the default behavior, as long as stdout is a terminal.
 
 * -y, --force-yes
 
diff --git a/debian/changelog b/debian/changelog
index ffa89da..c4fbf34 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ apt-listbugs (0.1.18) UNRELEASED; urgency=medium
   * updated Japanese translation, thanks to "victory"!
   * fixed a crash occurring after displaying the HTML bug lists
   * examples cleanup: dropped listbugs-soap.rb and updated other scripts
+  * fixed "implement an option to disable the automatic pin of all the
+    buggy packages": implemented the --force-no-pin option (Closes: #828108)
 
  -- Francesco Poli (wintermute) <invernomuto at paranoici.org>  Mon, 10 Aug 2015 22:42:49 +0200
 
diff --git a/lib/aptlistbugs/logic.rb b/lib/aptlistbugs/logic.rb
index d185844..7a416d4 100644
--- a/lib/aptlistbugs/logic.rb
+++ b/lib/aptlistbugs/logic.rb
@@ -64,6 +64,7 @@ class AppConfig
       _(" -q               : Don't display progress bar.\n"),
       _(" -C <apt.conf>    : apt.conf file to use.\n"),
       _(" -F               : Automatically pin all buggy packages.\n"),
+      _(" -N               : Never automatically pin packages.\n"),
       _(" -y               : Assume that you select yes for all questions.\n"),
       _(" -n               : Assume that you select no for all questions.\n"),
       _(" -d               : Debug.\n"),
@@ -106,7 +107,7 @@ class AppConfig
     @apt_conf = nil
 
     @yes = nil
-    @force_pin = false
+    @force_pin = nil
 
     @arrow = "->"
     if Locale.charset == "UTF-8"
@@ -152,6 +153,7 @@ class AppConfig
                            ['--quiet', '-q', GetoptLong::NO_ARGUMENT],
                            ['--aptconf', '-C', GetoptLong::REQUIRED_ARGUMENT],
                            ['--force-pin', '-F', GetoptLong::NO_ARGUMENT],
+                           ['--force-no-pin', '-N', GetoptLong::NO_ARGUMENT],
                            ['--force-yes', '-y', GetoptLong::NO_ARGUMENT],
                            ['--force-no', '-n', GetoptLong::NO_ARGUMENT],
                            ['--debug', '-d', GetoptLong::NO_ARGUMENT]
@@ -201,6 +203,8 @@ class AppConfig
           @yes = false
         when '--force-pin'
           @force_pin = true
+        when '--force-no-pin'
+          @force_pin = false
         end
       }
     rescue GetoptLong::AmbiguousOption, GetoptLong::NeedlessArgument,
@@ -212,7 +216,9 @@ class AppConfig
     if ! $stdout.isatty
       @quiet = true
       @yes = false if @yes.nil?
-      @force_pin = true
+      @force_pin = true if @force_pin.nil?
+    else
+      @force_pin = false if @force_pin.nil?
     end
 
     # warn the user about unknown (possibly misspelled) severities

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