summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-01 00:06:28 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-01 00:06:28 +0000
commitc848472a64928ad7102423f57e9743269be15db2 (patch)
tree7a95dcd933c57c0989dd29bb7b461c59c69f6b61
parent0dcca2925e699749886f4c5d4e339ec605bb0e94 (diff)
downloadurpmi-c848472a64928ad7102423f57e9743269be15db2.tar
urpmi-c848472a64928ad7102423f57e9743269be15db2.tar.gz
urpmi-c848472a64928ad7102423f57e9743269be15db2.tar.bz2
urpmi-c848472a64928ad7102423f57e9743269be15db2.tar.xz
urpmi-c848472a64928ad7102423f57e9743269be15db2.zip
(handle_need_restart) enable to test "should restart" again
it didn't work since commit r263652 on Tue Nov 24 2009 (was: "(handle_need_restart) do not advice to reboot when inside a chroot")
-rw-r--r--t/superuser--should-restart.t6
-rw-r--r--urpm/main_loop.pm2
2 files changed, 5 insertions, 3 deletions
diff --git a/t/superuser--should-restart.t b/t/superuser--should-restart.t
index 737ab311..04e0c9c5 100644
--- a/t/superuser--should-restart.t
+++ b/t/superuser--should-restart.t
@@ -2,9 +2,11 @@
# "a" provides "should-restart = system"
# "c" provides "should-restart = system"
-# this test fails since the "restart your computer" message was disabled when
+
+# this test would fail since the "restart your computer" message was disabled when
# urpmi is run with --urpmi-root
-#
+$ENV{URPMI_TEST_RESTART} = 1;
+
use strict;
use lib '.', 't';
use helper;
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index 3a9df65c..1e3247c1 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -364,7 +364,7 @@ sub run {
sub handle_need_restart {
my ($urpm, $state, $callbacks) = @_;
- return if $urpm->{root};
+ return if $urpm->{root} && !$ENV{URPMI_TEST_RESTART};
return if !$callbacks->{need_restart};
if (intersection([ keys %{$state->{selected}} ],