diff options
Diffstat (limited to 'lib/MGA/DrakISO/Loopback.pm')
-rw-r--r-- | lib/MGA/DrakISO/Loopback.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/MGA/DrakISO/Loopback.pm b/lib/MGA/DrakISO/Loopback.pm index e06d2a4..219b9b8 100644 --- a/lib/MGA/DrakISO/Loopback.pm +++ b/lib/MGA/DrakISO/Loopback.pm @@ -55,14 +55,13 @@ our %loop_types; my $root = $dir->{root} || $build->get_system_root; my $src = $root . $dir->{build_from}; my $total = directory_usage($src); - print "have to process " . int($total/1000000) . " MB\n"; + print "Have to process " . int($total/1000000) . " MB\n" if $::verbose; my $exclude_file = tmpnam(); output_p($exclude_file, map { $root . "$_\n" } grep { -e $root . $_ } @{$dir->{exclude} || []}); my $sort = $build->{settings}{config_root} . '/' . $dir->{sort}; my $squashfs4_comp = best_squashfs4_compression($build); - run_($squashfs4_comp ? 'mksquashfs' : 'mksquashfs3', - # unless/until we get a quiet option - if_($::verbose < 2, '>', '/dev/null'), + run_as_root(join(' ', + $squashfs4_comp ? 'mksquashfs' : 'mksquashfs3', $src, $dest, $squashfs4_comp ? ('-comp', $squashfs4_comp) : '-lzma', '-noappend', '-b', '1048576', @@ -71,7 +70,9 @@ our %loop_types; if_(-f $sort, '-sort', $sort), if_($::verbose > 2, '-info', '-progress'), if_($::verbose < 2, '-no-progress'), - ) or die "unable to run mksquashfs\n"; + # due to lack of a -quiet option + if_($::verbose < 2, '> /dev/null'), + )) or die "ERROR: unable to run mksquashfs\n"; unlink $exclude_file; }, mount => sub { |