From eaa10d73da3e73091949f9a4d6df66a19b03a8e8 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 3 Oct 2017 23:45:10 +0100 Subject: Do not use chroot urpmi Either use urpmi --root or urpmi --urpmi-root so that packages can be installed without networking inside the chroot. --- NEWS | 1 + lib/Iurt/Urpmi.pm | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 21978ed..376caa4 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - iurt: also use --urpmi-root for urpmi.addmedia +- iurt: always use --root or --urpmi-root, not plain chroot to call urpmi 0.7.0 - iurt: support resuming a full rebuild diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 401ae91..ff702bd 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -38,7 +38,12 @@ sub new { sub set_command { my ($self, $_chroot_tmp) = @_; - $self->{use__urpmi_root} ? &set_command__urpmi_root : &set_command__use_distrib; + if ($run->{chrooted_urpmi}) { + # FIXME chrooted_urpmi should always use urpmi_root and not support local media + $self->{use__urpmi_root} ? &set_command__urpmi_root : &set_command__use_distrib; + } else { + &set_command__use_distrib; + } } sub set_command__urpmi_root { my ($self, $chroot_tmp) = @_; @@ -50,10 +55,6 @@ sub set_command__use_distrib { $self->{use_iurt_root_command} = 1; $self->{urpmi_command} = "urpmi $self->{urpmi_options} --use-distrib $self->{distrib_url} --root $chroot_tmp"; } -sub set_command__chrooted { - my ($self, $chroot_tmp) = @_; - $self->{urpmi_command} = "chroot $chroot_tmp urpmi $self->{urpmi_options} "; -} sub set_local_media { my ($self, $local_media) = @_; @@ -164,7 +165,6 @@ sub urpmi_command { add_media($self, $chroot_tmp, 'iurt_group', "iurt_group file:///iurt_media") or next; } - $self->set_command__chrooted($chroot_tmp); return 1; } else { $self->set_command($chroot_tmp); -- cgit v1.2.1