diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2020-12-10 13:59:38 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2020-12-10 14:02:22 +0000 |
commit | 535b7c28eac6c4c85118752c923c05a1bb21947c (patch) | |
tree | 88ef680858a9afbd7dd5ee47b4ad55266ab32d2d /lib | |
parent | f2b5971775335a71c4031d0667471bc28639bc7f (diff) | |
download | drakiso-535b7c28eac6c4c85118752c923c05a1bb21947c.tar drakiso-535b7c28eac6c4c85118752c923c05a1bb21947c.tar.gz drakiso-535b7c28eac6c4c85118752c923c05a1bb21947c.tar.bz2 drakiso-535b7c28eac6c4c85118752c923c05a1bb21947c.tar.xz drakiso-535b7c28eac6c4c85118752c923c05a1bb21947c.zip |
Support use of https in repository URLs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MGA/DrakISO/BuildMedia.pm | 2 | ||||
-rw-r--r-- | lib/MGA/DrakISO/BuildRoot.pm | 4 | ||||
-rw-r--r-- | lib/MGA/DrakISO/Utils.pm | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/MGA/DrakISO/BuildMedia.pm b/lib/MGA/DrakISO/BuildMedia.pm index dced6e5..b7a377d 100644 --- a/lib/MGA/DrakISO/BuildMedia.pm +++ b/lib/MGA/DrakISO/BuildMedia.pm @@ -579,7 +579,7 @@ sub read_repo_product_id { my $src_file = $build->{settings}{repository} . '/' . $build->{settings}{arch} . '/product.id'; my $product_id; - if ($src_file =~ m!^(ftp|http)://!) { + if ($src_file =~ m!^(ftp|https?)://!) { $product_id = `curl --silent $src_file`; $? and die "ERROR: couldn't fetch product.id file from repository\n"; } else { diff --git a/lib/MGA/DrakISO/BuildRoot.pm b/lib/MGA/DrakISO/BuildRoot.pm index b20dc34..995b419 100644 --- a/lib/MGA/DrakISO/BuildRoot.pm +++ b/lib/MGA/DrakISO/BuildRoot.pm @@ -62,7 +62,7 @@ sub install_live_system { my $base_repository = $build->{settings}{repository}; my $arch_repository = $base_repository . '/' . $arch; - my $remote_method = $arch_repository =~ m!^(ftp|http)://! && $1; + my $remote_method = $arch_repository =~ m!^(ftp|https?)://! && ($1 =~ s/https/http/r); my $chroot = $build->get_chroot_dir; @@ -683,7 +683,7 @@ sub copy_file_to_root { my ($root, $dst_dir, $mode, $src_file) = @_; my $dst_file = $dst_dir . '/' . basename($src_file); - if ($src_file =~ m!^(ftp|http)://!) { + if ($src_file =~ m!^(ftp|https?)://!) { run_as_root('curl', '--silent', '-o', $root . $dst_file, $src_file) or die "ERROR: couldn't copy $src_file to $dst_file\n"; } else { diff --git a/lib/MGA/DrakISO/Utils.pm b/lib/MGA/DrakISO/Utils.pm index cb2702d..e604652 100644 --- a/lib/MGA/DrakISO/Utils.pm +++ b/lib/MGA/DrakISO/Utils.pm @@ -84,7 +84,7 @@ sub run_in_root { sub copy_or_link { my ($src_file, $dst_file) = @_; mkdir_p(dirname($dst_file)); - if ($src_file =~ m!^(ftp|http)://!) { + if ($src_file =~ m!^(ftp|https?)://!) { run_as_root('curl', '--silent', '-o', $dst_file, $src_file) or die "ERROR: couldn't copy $src_file to $dst_file\n"; } else { |