summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/Utils.pm
diff options
context:
space:
mode:
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 {