[Apt-listbugs-commits] [apt-listbugs] 01/01: fall back to auto-pin mode if stdout is not a tty

Francesco Poli frx-guest at moszumanska.debian.org
Wed May 21 22:19:46 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 2a78514ca823cbfbe03dc5dee3e83d86cb9b874e
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Thu May 22 00:16:46 2014 +0200

    fall back to auto-pin mode if stdout is not a tty
---
 apt-listbugs              |  3 ++-
 debian/README.Debian      | 60 ++++++++++++-----------------------------------
 debian/changelog          |  3 +++
 lib/apt-listbugs/logic.rb |  1 +
 4 files changed, 21 insertions(+), 46 deletions(-)

diff --git a/apt-listbugs b/apt-listbugs
index 0d3087e..2720b85 100755
--- a/apt-listbugs
+++ b/apt-listbugs
@@ -133,7 +133,8 @@ apt-listbugs [-h] [-v] [-s <severities>] [-T <tags>] [-S <states>] [-B <bug#>] [
 * -F, --force-pin
 
   When in apt mode, assumes that you want to automatically pin all buggy
-  packages without any prompt.
+  packages without any prompt.  This option is assumed if stdout is not a
+  terminal.
 
 * -y, --force-yes
 
diff --git a/debian/README.Debian b/debian/README.Debian
index 6b34672..096a708 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -84,8 +84,8 @@ Need for a controlling terminal
 ===============================
 
 apt-listbugs requires a controlling terminal for user interaction.
-It will default to non-interactive failure mode if its standard output
-is not a tty.
+It will default to non-interactive auto-pin mode (equivalent to
+options -qnF), if its standard output is not a tty.
 
 
 Current Design Limitation
@@ -126,49 +126,19 @@ installations/upgrades (e.g.: see the cron-apt package) a little harder.
 
 With its default configuration, apt-listbugs will stop any
 automatic installation or upgrade, whenever the packages to be
-installed or upgraded are affected by RC bugs.
-
-If this is the desired behavior, no special action is needed; you may
-safely skip the rest of this section.
-
-On the other hand, if you want apt-listbugs to merely show bugs,
-without stopping the installation/upgrade process, you can obtain this
-behavior by editing /etc/apt/apt.conf.d/10apt-listbugs to add the "yes"
-option "-y": the following line
-
-    DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt";};
-
-should become
-
-    DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs -y apt";};
-
-Finally, if you want apt-listbugs to automatically pin all buggy packages
-and then let the unattended process upgrade the remaining packages,
-you can obtain this behavior by using the "force-pin" option "-F"
-(combined with the "no" option "-n", in order to make the process stop
-in presence of network errors and the like):
-
-    DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs -nF apt";};
-
-Please note that you will have to configure the unattended upgrade
-process to attempt the upgrade twice in a row: the first attempt will
-pin all the buggy packages, if any; the second attempt will upgrade
-the remaining packages.
-
-Please also note that this configuration could even be made conditional:
-
-    DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs $APT_LISTBUGS_OPTS apt";};
-
-This way, apt-listbugs will avoid stopping the installation/upgrade
-process *only* if an APT_LISTBUGS_OPTS environment variable is set to "-y".
-Or it will automatically pin buggy packages, if an APT_LISTBUGS_OPTS
-environment variable is set to "-nF".
-Otherwise, if APT_LISTBUGS_OPTS is unset (or set to a zero-length
-string), apt-listbugs will behave as usual.
-
-However, such a conditional configuration is probably a bit risky,
-since *anything* could be included (even by mistake) in the
-APT_LISTBUGS_OPTS environment variable.
+installed or upgraded are affected by RC bugs. Buggy packages
+will also be automatically pinned.
+
+If you want the unattended process to upgrade the remaining packages, after
+apt-listbugs has pinned all the buggy packages, you will have to
+configure the unattended process to attempt the upgrade twice in a row:
+the first attempt will pin all the buggy packages, if any; the second
+attempt will upgrade the remaining packages.
+
+On the other hand, if you want apt-listbugs to do nothing at all
+during unattended package installations/upgrades, you may configure the
+unattended process to set the APT_LISTBUGS_FRONTEND environment
+variable to "none" before invoking the package manager.
 
 
 Why does apt-listbugs ignore the "affects" field?
diff --git a/debian/changelog b/debian/changelog
index 1418e19..ef572e2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ apt-listbugs (0.1.14) UNRELEASED; urgency=medium
     library fails to load, suggest a possible way to fix things up
     and then exit with error (Closes: #747487)
   * simplified use of dpkg-parsechangelog in various places
+  * made the --force-pin option the new fallback mode for all cases
+    where standard output is not a tty (this implies that unattended
+    installations/upgrades will automatically pin buggy packages!)
 
  -- 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 9cdf2b0..8426892 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -214,6 +214,7 @@ class AppConfig
     if ! $stdout.isatty
       @quiet = true
       @yes = false if @yes.nil?
+      @force_pin = true
     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