Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package needrestart

It fixes a regression if needrestart is invoked in noninteractive mode.

diff -Naur '--exclude=.svn' 1.2-7/debian/changelog 1.2-8/debian/changelog
--- 1.2-7/debian/changelog      2014-12-18 21:53:53.165140592 +0100
+++ 1.2-8/debian/changelog      2015-03-24 10:27:26.043543580 +0100
@@ -1,3 +1,11 @@
+needrestart (1.2-8) unstable; urgency=low
+
+  * Add patch 16-fix-progressbar-regression to improve detection if invoked
+    noninteractive and prevent debconf tried to be used in such cases. The
+    reload action is set to list only if it was inter-active.
+
+ -- Patrick Matthäi <pmatth...@debian.org>  Tue, 24 Mar 2015 10:24:33 +0100
+
 needrestart (1.2-7) unstable; urgency=low

   * Add missing second patch 15-fix-progressbar-non-interactive to fix #768124.
diff -Naur '--exclude=.svn' 
1.2-7/debian/patches/16-fix-progressbar-regression.diff 
1.2-8/debian/patches/16-fix-progressbar-regression.diff
--- 1.2-7/debian/patches/16-fix-progressbar-regression.diff     1970-01-01 
01:00:00.000000000 +0100
+++ 1.2-8/debian/patches/16-fix-progressbar-regression.diff     2015-03-24 
10:27:26.063543578 +0100
@@ -0,0 +1,55 @@
+# Improve detection if invoked noninteractive and prevent debconf tried to be
+# used in such cases. The reload action is set to list only if it was inter-
+# active.
+# Related: #768124
+
+---
+ needrestart                | 4 +++-
+ perl/lib/NeedRestart/UI.pm | 2 +-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/needrestart b/needrestart
+index a1c43d9..a31a8bc 100755
+--- a/needrestart
++++ b/needrestart
+@@ -39,6 +39,7 @@ $Getopt::Std::STANDARD_HELP_VERSION++;
+
+ my $LOGPREF = '[main]';
+ my $is_systemd = -d qq(/run/systemd/system);
++my $is_tty = (-t *STDERR || -t *STDOUT || -t *STDIN);
+
+ sub HELP_MESSAGE {
+     print <<USG;
+@@ -131,6 +132,7 @@ $nrconf{ui} = qq(NeedRestart::UI::stdio) 
if($nrconf{verbose});
+ die "Hook directory '$nrconf{hook_d}' is invalid!\n" unless(-d 
$nrconf{hook_d} || $opt_b);
+ $opt_r = $nrconf{restart} unless(defined($opt_r));
+ die "ERROR: Unknown restart option '$opt_r'!\n" unless($opt_r =~ /^(l|i|a)$/);
++$opt_r = 'l' if(!$is_tty && $opt_r eq 'i');
+
+ $nrconf{defno}++ if($opt_n);
+
+@@ -142,7 +144,7 @@ chomp($runlevel);
+ $runlevel = 2 unless($runlevel =~ s/^.+run-level (\S)\s.+$/$1/);
+
+ # get UI
+-my $ui = ($opt_b ? NeedRestart::UI->new(1) : needrestart_ui($nrconf{verbose}, 
$nrconf{ui}));
++my $ui = ($opt_b ? NeedRestart::UI->new(1) : needrestart_ui($nrconf{verbose}, 
($is_tty ? $nrconf{ui} : 'NeedRestart::UI::stdio')));
+ die "Error: no UI class available!\n" unless(defined($ui));
+
+ # enable/disable checks
+diff --git a/perl/lib/NeedRestart/UI.pm b/perl/lib/NeedRestart/UI.pm
+index 08004f9..d7e8e77 100644
+--- a/perl/lib/NeedRestart/UI.pm
++++ b/perl/lib/NeedRestart/UI.pm
+@@ -42,7 +42,7 @@ sub progress_prep($$$) {
+     my $self = shift;
+     my ($max, $out) = @_;
+
+-    unless($self->{debug} || !exists($ENV{COLUMNS}) || !exists($ENV{LINES})) {
++    unless($self->{debug} || !(-t *STDERR)) {
+       # restore terminal if required (debconf)
+       unless(-t *STDIN) {
+           open($self->{fhin}, '<&', \*STDIN) || die "Can't dup stdin: $!\n";
+--
+2.1.4
+
diff -Naur '--exclude=.svn' 1.2-7/debian/patches/series 
1.2-8/debian/patches/series
--- 1.2-7/debian/patches/series 2014-12-18 21:53:53.169140561 +0100
+++ 1.2-8/debian/patches/series 2015-03-24 10:27:26.063543578 +0100
@@ -13,3 +13,4 @@
 13-falsepos-aio-fix.diff
 14-wpa_supplicant-override.diff
 15-fix-progressbar-non-interactive.diff
+16-fix-progressbar-regression.diff


unblock needrestart/1.2-8

-- System Information:
Debian Release: 7.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to