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, 9 insertions, 1 deletions
diff --git a/lib/MGA/DrakISO/Utils.pm b/lib/MGA/DrakISO/Utils.pm
index ee1068f..c3533a4 100644
--- a/lib/MGA/DrakISO/Utils.pm
+++ b/lib/MGA/DrakISO/Utils.pm
@@ -30,7 +30,7 @@ use IO::Select;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(directory_usage run_ mount_system_fs umount_external_fs);
+our @EXPORT = qw(directory_usage run_ copy_or_link mount_system_fs umount_external_fs);
sub directory_usage {
my ($dir, $o_apparent) = @_;
@@ -81,6 +81,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";
+}
+
sub mount_system_fs {
my ($build) = @_;
run_('mount', '-t', 'devtmpfs', '/dev', $build->get_system_root . '/dev');