summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/Utils.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-03-03 22:37:04 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-03-03 22:37:04 +0000
commit5295430b1fc68246a39c96efd8e593de9322f222 (patch)
tree1a421442b56bc6862192265969ad953a90e6b6e8 /lib/MGA/DrakISO/Utils.pm
parent05d79cc9042e544008aebb9a9cad37d8867e6742 (diff)
downloaddrakiso-5295430b1fc68246a39c96efd8e593de9322f222.tar
drakiso-5295430b1fc68246a39c96efd8e593de9322f222.tar.gz
drakiso-5295430b1fc68246a39c96efd8e593de9322f222.tar.bz2
drakiso-5295430b1fc68246a39c96efd8e593de9322f222.tar.xz
drakiso-5295430b1fc68246a39c96efd8e593de9322f222.zip
Complete support for using a remote repository.
Diffstat (limited to 'lib/MGA/DrakISO/Utils.pm')
-rw-r--r--lib/MGA/DrakISO/Utils.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/MGA/DrakISO/Utils.pm b/lib/MGA/DrakISO/Utils.pm
index 0f97080..b0a942d 100644
--- a/lib/MGA/DrakISO/Utils.pm
+++ b/lib/MGA/DrakISO/Utils.pm
@@ -111,10 +111,14 @@ sub device_mkfs {
sub copy_or_link {
my ($src_file, $dst_file) = @_;
- # TODO: support remote sources.
mkdir_p(dirname($dst_file));
- symlinkf($src_file, $dst_file)
- or die "ERROR: couldn't link $src_file to $dst_file\n";
+ if ($src_file =~ m!^(ftp|http)://!) {
+ run_as_root('curl', '--silent', '-o', $dst_file, $src_file)
+ or die "ERROR: couldn't copy $src_file to $dst_file\n";
+ } else {
+ symlinkf($src_file, $dst_file)
+ or die "ERROR: couldn't link $src_file to $dst_file\n";
+ }
}
sub mk_dev_null {