diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-04-17 20:50:17 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-04-17 20:50:17 +0000 |
commit | 66ab797e670d51917a4e1d7f1712d4ec9da11df2 (patch) | |
tree | cbd800d28b97b04f7042592cec161b3cca1335f4 | |
parent | e551cc2e53a861826589fec414c79c232c9a934e (diff) | |
download | iurt-66ab797e670d51917a4e1d7f1712d4ec9da11df2.tar iurt-66ab797e670d51917a4e1d7f1712d4ec9da11df2.tar.gz iurt-66ab797e670d51917a4e1d7f1712d4ec9da11df2.tar.bz2 iurt-66ab797e670d51917a4e1d7f1712d4ec9da11df2.tar.xz iurt-66ab797e670d51917a4e1d7f1712d4ec9da11df2.zip |
(clean_chroot,new,urpmi_command) simplify using urpm::is_local_url()
-rw-r--r-- | lib/Iurt/Chroot.pm | 3 | ||||
-rw-r--r-- | lib/Iurt/Urpmi.pm | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index f0d1e4b..1ed50f6 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -9,6 +9,7 @@ use Iurt::Config qw(dump_cache_par); use Iurt::Util qw(plog); use File::Temp 'mktemp'; use File::Path 'mkpath'; +use urpm; our @EXPORT = qw( clean_chroot_tmp @@ -92,7 +93,7 @@ sub clean_chroot { if ($run->{additional_media} && $run->{additional_media}{repository}) { my $rep = $run->{additional_media}{repository}; - if ($rep !~ m/^(ftp|https?|rsync):)/) { + if (urpm::is_local_url($rep)) { my $mount_point = "$chroot/urpmi_medias"; my $url = $rep; $url =~ s!^file://!!; diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index df4a5bd..9e20a97 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -9,7 +9,7 @@ use Iurt::Chroot qw(add_local_user create_temp_chroot); use Iurt::Process qw(perform_command clean_process sudo); use Iurt::Config qw(dump_cache_par get_maint get_package_prefix); use Iurt::Util qw(plog); - +use urpm; sub new { my ($class, %opt) = @_; @@ -30,7 +30,7 @@ sub new { plog('DEBUG', "installation media: $run->{chrooted_media}"); } - $self->{use__urpmi_root} = $config->{repository} =~ m/^(ftp|https?|rsync):/; + $self->{use__urpmi_root} = urpm::is_local_url($config->{repository}); $self->{distrib_url} = "$config->{repository}/$run->{distro}/$run->{my_arch}"; $self; @@ -120,7 +120,7 @@ sub urpmi_command { $name =~ s![/:]!_!g; my $url; - if ($run->{additional_media}{repository} =~ m!^(ftp|https?|rsync):!) { + if (urpm::is_local_url($run->{additional_media}{repository})) { $url = $run->{additional_media}{repository}; } else { |