print out fianl commpressed archive size and format better

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-09-24 17:29:49 +02:00
parent 1e25020c9b
commit 18ef2f8c0d
1 changed files with 6 additions and 1 deletions

View File

@ -645,7 +645,7 @@ sub finalize {
} else { } else {
die "unable to detect size\n"; die "unable to detect size\n";
} }
$self->logmsg ("$size MB\n"); $self->logmsg ("uncompressed size: $size MB\n");
$self->write_config ("$rootdir/etc/appliance.info", $size); $self->write_config ("$rootdir/etc/appliance.info", $size);
@ -657,7 +657,12 @@ sub finalize {
$self->run_command ("tar cpf $target --numeric-owner -C '$rootdir' ./etc/appliance.info"); $self->run_command ("tar cpf $target --numeric-owner -C '$rootdir' ./etc/appliance.info");
$self->run_command ("tar rpf $target --numeric-owner -C '$rootdir' --exclude ./etc/appliance.info ."); $self->run_command ("tar rpf $target --numeric-owner -C '$rootdir' --exclude ./etc/appliance.info .");
$self->logmsg ("compressing archive\n");
$self->run_command ("gzip $target"); $self->run_command ("gzip $target");
my $target_size = int(-s "$target.gz") >> 20;
$self->logmsg ("created '$target.gz' with size: $target_size MB\n");
} }
sub enter { sub enter {