From 2555e822666eaa44c9e52b62c68e34512612645d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 22 Nov 2007 16:21:26 +0000 Subject: prepare for --urpmi-root: - create ->set_command__urpmi_root (which is an alternative to set_command__use_distrib) - create ->add_media__urpmi_root (to be used in build_chroot() when we want to use --urpmi-root instead of --use-distrib) --- lib/Iurt/Urpmi.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/Iurt/Urpmi.pm') diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index d0a34fb..0162462 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -48,6 +48,10 @@ sub new { sub set_command { &set_command__use_distrib } +sub set_command__urpmi_root { + my ($self, $chroot_tmp) = @_; + $self->{urpmi_command} = "urpmi $self->{urpmi_options} --urpmi-root $chroot_tmp"; +} sub set_command__use_distrib { my ($self, $chroot_tmp) = @_; $self->{urpmi_command} = "urpmi $self->{urpmi_options} --use-distrib $self->{distrib_url} --root $chroot_tmp"; @@ -180,6 +184,23 @@ sub check_media_added { $medias =~ /$media/m; } +sub add_media__urpmi_root { + my ($self, $chroot) = @_; + my $run = $self->{run}; + my $config = $self->{config}; + my $cache = $run->{cache}; + + plog("adding distrib $self->{distrib_url} with option --urpmi-root in chroot $chroot"); + + perform_command("sudo urpmi.addmedia -v --urpmi-root $chroot --distrib $self->{distrib_url} --probe-synthesis", + $run, $config, $cache, + mail => $config->{admin}, + timeout => 300, + freq => 1, + retry => 2, + debug_mail => $run->{debug}); +} + sub add_media { my ($self, $chroot, $regexp, $media) = @_; my $run = $self->{run}; -- cgit v1.2.1