From 1829b4d804f1c10a23eb58e23d512f6528544a8c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 22 Nov 2007 15:59:37 +0000 Subject: factorize code setting {urpmi_command} --- lib/Iurt/Urpmi.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Iurt') diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index 4de91b4..5305135 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -49,6 +49,9 @@ sub new { sub set_command { my ($self, $chroot_tmp) = @_; + set_command__use_distrib($self, $chroot_tmp); +} +sub set_command__use_distrib { $self->{urpmi_command} = "urpmi $self->{urpmi_options} $self->{urpmi_media_options} --root $chroot_tmp"; } @@ -72,7 +75,7 @@ sub urpmi_command { #plog(3, "urpmi_command ($chroot_tmp user $luser)"); if ($run->{chrooted_urpmi}) { - $self->{urpmi_command} = "urpmi $self->{urpmi_options} $self->{urpmi_media_options} --root $chroot_tmp "; + $self->set_command__use_distrib($chroot_tmp); # CM: commented out # this was causing rpm database corruption problems and the packages @@ -164,7 +167,7 @@ sub urpmi_command { $self->{urpmi_command} = "chroot $chroot_tmp urpmi $self->{urpmi_options} "; return 1; } else { - $self->{urpmi_command} = "urpmi $self->{urpmi_options} $self->{urpmi_media_options} --root $chroot_tmp"; + $self->set_command__use_distrib($chroot_tmp); } } -- cgit v1.2.1