From bf8f0ca200903262e7a33ca27216ebebf9d73687 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 4 Aug 2023 12:48:23 +0200 Subject: [PATCH] download file from url: fix indentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/PVE/Tools.pm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 159ec82..41e2724 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -2054,21 +2054,21 @@ sub download_file_from_url { } } - if (my $cmd = $opts->{decompression_command}) { - push @$cmd, $tmp_download; - my $fh; - if (!open($fh, ">", "$tmp_decomp")) { - die "cant open temporary file $tmp_decomp for decompresson: $!\n"; - } - print "decompressing $tmp_download to $tmp_decomp\n"; - eval { run_command($cmd, output => '>&'.fileno($fh)); }; - my $err = $@; - unlink $tmp_download; - die "$err\n" if $err; - rename($tmp_decomp, $dest) or die "unable to rename temporary file: $!\n"; - } else { - rename($tmp_download, $dest) or die "unable to rename temporary file: $!\n"; - } + if (my $cmd = $opts->{decompression_command}) { + push @$cmd, $tmp_download; + my $fh; + if (!open($fh, ">", "$tmp_decomp")) { + die "cant open temporary file $tmp_decomp for decompresson: $!\n"; + } + print "decompressing $tmp_download to $tmp_decomp\n"; + eval { run_command($cmd, output => '>&'.fileno($fh)); }; + my $err = $@; + unlink $tmp_download; + die "$err\n" if $err; + rename($tmp_decomp, $dest) or die "unable to rename temporary file: $!\n"; + } else { + rename($tmp_download, $dest) or die "unable to rename temporary file: $!\n"; + } }; if (my $err = $@) { unlink $tmp_download or warn "could not cleanup temporary file: $!"; -- 2.39.5