[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [rbm/master] Bug 32527: Don't leave partially downloaded files in case of error
commit 94fce31e54d3fd491cdb3e3b9401919c0e841360
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date: Wed Nov 20 16:44:13 2019 +0100
Bug 32527: Don't leave partially downloaded files in case of error
---
lib/RBM/DefaultConfig.pm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/RBM/DefaultConfig.pm b/lib/RBM/DefaultConfig.pm
index f7de8bb..974a0e1 100644
--- a/lib/RBM/DefaultConfig.pm
+++ b/lib/RBM/DefaultConfig.pm
@@ -555,7 +555,13 @@ OPT_END
return $install{"$distro-$release"} if $install{"$distro-$release"};
return $install{$distro};
},
- urlget => 'wget -O[% shell_quote(dest_dir _ "/" _ c("filename")) %] [% shell_quote(c("URL")) %]',
+ urlget => <<URLGET,
+#!/bin/sh
+set -e
+tmpfile="\$(mktemp -p [% shell_quote(c("tmp_dir")) %])"
+wget -O"\$tmpfile" [% shell_quote(c("URL")) %]
+mv -f "\$tmpfile" [% shell_quote(dest_dir _ "/" _ c("filename")) %]
+URLGET
sig_ext => [ qw(gpg asc sig) ],
enable => 1,
gnu_utils => sub {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits