]> git.proxmox.com Git - pve-common.git/commitdiff
download file from url: fix indentation
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 4 Aug 2023 10:48:23 +0000 (12:48 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 4 Aug 2023 10:48:23 +0000 (12:48 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/Tools.pm

index 159ec8259fac6e9a7dc25c90901cc749748e5c44..41e2724c6895f6a85148683b6297f6469297057a 100644 (file)
@@ -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: $!";