2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00

Handle the output of cpio properly

This commit is contained in:
GONG Jie
2019-03-12 15:41:43 +08:00
parent dd394f6f6e
commit 0278e8962c

View File

@ -2261,7 +2261,11 @@ sub copycd
my $copied = 0;
my ($percent, $fout);
while (<PIPE>) {
next if /^cpio:/;
if (/^cpio:/) {
chomp;
$callback->({ data => $_ });
next;
}
$percent = $copied / $numFiles;
$fout = sprintf "%0.2f%%", $percent * 100;
$callback->({ sinfo => "$fout" });