summaryrefslogtreecommitdiffstats
path: root/urpm/sys.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-18 09:11:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-18 09:11:33 +0000
commit2d334b04228f9ac254b21816567e45a6e08fe9d4 (patch)
tree0d287318d48715835577e6dbbe7cbd8075b1f0fc /urpm/sys.pm
parent7117441a1ed466bc2531618ed97639345cb451f7 (diff)
downloadurpmi-2d334b04228f9ac254b21816567e45a6e08fe9d4.tar
urpmi-2d334b04228f9ac254b21816567e45a6e08fe9d4.tar.gz
urpmi-2d334b04228f9ac254b21816567e45a6e08fe9d4.tar.bz2
urpmi-2d334b04228f9ac254b21816567e45a6e08fe9d4.tar.xz
urpmi-2d334b04228f9ac254b21816567e45a6e08fe9d4.zip
handle need_restart() rooted (not very useful, except for tests!)
Diffstat (limited to 'urpm/sys.pm')
-rw-r--r--urpm/sys.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 08baa0ff..acbc5a9e 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -161,9 +161,11 @@ sub _launched_time {
}
}
-sub need_restart() {
+sub need_restart {
+ my ($root) = @_;
my $rpm_qf = '%{name} %{installtime} [%{provides}:%{Provideversion} ]\n';
- open(my $F, "rpm -q --whatprovides should-restart --qf '$rpm_qf' | uniq |");
+ my $options = ($root ? "--root $root " : '') . "-q --whatprovides should-restart --qf '$rpm_qf'";
+ open(my $F, "rpm $options | uniq |");
my (%need_restart, %launched_time);
while (my $line = <$F>) {
@@ -181,8 +183,9 @@ sub need_restart() {
%need_restart && \%need_restart;
}
-sub need_restart_formatted() {
- my $need_restart = need_restart() or return;
+sub need_restart_formatted {
+ my ($root) = @_;
+ my $need_restart = need_restart($root) or return;
foreach (keys %$need_restart) {
$need_restart->{$_} = N("You should restart %s for %s", translate($_), join(', ', sort @{$need_restart->{$_}}));