From 535b7c28eac6c4c85118752c923c05a1bb21947c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Thu, 10 Dec 2020 13:59:38 +0000 Subject: Support use of https in repository URLs. --- lib/MGA/DrakISO/BuildMedia.pm | 2 +- lib/MGA/DrakISO/BuildRoot.pm | 4 ++-- lib/MGA/DrakISO/Utils.pm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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 { -- cgit v1.2.1