[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. apt-listbugs/0.1.6-10-gbbc8975

Francesco Poli (wintermute) invernomuto at paranoici.org
Sun May 13 21:07:15 UTC 2012


The following commit has been merged in the master branch:
commit 50f6cf274fbb0960cd360b395d5d27c0c309d2cd
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Sat May 12 18:31:01 2012 +0200

    test access to /dev/tty only in apt mode

diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index 3dff4ea..d735d70 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -174,17 +174,6 @@ class AppConfig
       @yes = false if @yes.nil?
     end
 
-    begin
-      test_tty = File.open("/dev/tty")
-      test_tty.close if test_tty
-    rescue
-      if @yes.nil?
-        $stderr.puts _("W: cannot open /dev/tty: running inside su -c \"command\"? switching to non-interactive failure mode, please see README.Debian.")
-        @yes = false
-      end
-      @quiet = true
-    end
-
     @title = "Debian Bugs (#{@severity.join(', ')})" if ! @title
 
     # http_proxy sanity check
@@ -240,6 +229,19 @@ class AppConfig
       exit 1
     end
 
+    if @command == "apt"
+      begin
+        test_tty = File.open("/dev/tty")
+        test_tty.close if test_tty
+      rescue
+        if @yes.nil?
+          $stderr.puts _("W: cannot open /dev/tty: running inside su -c \"command\"? switching to non-interactive failure mode, please see README.Debian.")
+          @yes = false
+        end
+        @quiet = true
+      end
+    end
+
     @parser =
       Debian::BTS::Parser::SoapIndex.new(@hostname, @port)
 

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list