From ff30da3ebb107421372e2a1a6d37f7c189667f2b Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 10 Jan 2018 09:03:20 +0000 Subject: Simplify run_() helper function and minimise direct calls to system(). --- lib/MGA/DrakISO/BuildRoot.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/MGA/DrakISO/BuildRoot.pm') diff --git a/lib/MGA/DrakISO/BuildRoot.pm b/lib/MGA/DrakISO/BuildRoot.pm index 187e8a2..a0cc6a2 100644 --- a/lib/MGA/DrakISO/BuildRoot.pm +++ b/lib/MGA/DrakISO/BuildRoot.pm @@ -78,25 +78,25 @@ sub install_live_system { my $error_message; try { # Mount the directory where we want to install the Live system. - mount($chroot . '/mnt', $live_root, '-o bind'); + mount($chroot . '/mnt', $live_root, '--bind'); # Mount the standard system pseudo-filesystems, so that the installer # has a proper environment to run in. mount_system_fs($chroot); - mount($chroot . '/sys/kernel/debug', 'none', '-t debugfs'); + mount($chroot . '/sys/kernel/debug', 'none', '-t', 'debugfs'); # Mount the stage2 installer filesystem. if ($remote_method) { my $local_mdkinst = $chroot . '/tmp/mdkinst.sqfs'; - system("curl --silent -o $local_mdkinst $arch_repository/install/stage2/mdkinst.sqfs") + run_('curl', '--silent', '-o', $local_mdkinst, $arch_repository . '/install/stage2/mdkinst.sqfs') or die "ERROR: failed to download mdkinst.sqfs from remote repository\n"; - mount($chroot_stage2, $local_mdkinst, '-t squashfs -o loop,ro'); + mount($chroot_stage2, $local_mdkinst, '-t', 'squashfs', '-o', 'loop,ro'); } elsif (-d $arch_repository . '/install/stage2/live') { - mount($chroot_stage2, $arch_repository . '/install/stage2/live', '-o bind,ro'); + mount($chroot_stage2, $arch_repository . '/install/stage2/live', '--bind', '-o', 'ro'); } elsif (-f $arch_repository . '/install/stage2/mdkinst.sqfs') { - mount($chroot_stage2, $arch_repository . '/install/stage2/mdkinst.sqfs', '-t squashfs -o loop,ro'); + mount($chroot_stage2, $arch_repository . '/install/stage2/mdkinst.sqfs', '-t', 'squashfs', '-o', 'loop,ro'); } else { die "ERROR: failed to find installer stage2\n"; @@ -104,7 +104,7 @@ sub install_live_system { # The stage2 installer expects to find the full repository in this # location... - mount($chroot . '/tmp/media', $base_repository, '-o bind,ro') if !$remote_method; + mount($chroot . '/tmp/media', $base_repository, '--bind', '-o', 'ro') if !$remote_method; # and the arch-specific repository in this location. symlinkf('media/' . $arch, $chroot . '/tmp/image'); # Because the installer uses the above symlink, relative paths in -- cgit v1.2.1