aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Urpmi.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt/Urpmi.pm')
-rw-r--r--lib/Iurt/Urpmi.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index 7ac6a74..0430fd0 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -208,6 +208,27 @@ sub add_media {
1;
}
+sub update {
+ my ($self, $chroot) = @_;
+ my $run = $self->{run};
+ my $config = $self->{config};
+
+ plog('INFO', "updating packages in $chroot");
+
+ my $cmd = "chroot $chroot urpmi --auto-update --auto";
+ if ($run->{chrooted_urpmi}) {
+ $cmd = "urpmi --urpmi-root $chroot --auto-update --auto";
+ }
+ perform_command($cmd,
+ $run, $config,
+ mail => $config->{admin},
+ retry => 2,
+ use_iurt_root_command => 1,
+ debug_mail => $run->{debug})
+ or return;
+ 1;
+}
+
sub get_local_provides {
my ($self) = @_;
my $run = $self->{run};