aboutsummaryrefslogtreecommitdiff
path: root/libs/common
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-06-27 05:33:18 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-06-28 00:21:04 -0400
commitf1c378c027db012956d5e8a9585004250550d581 (patch)
tree81d87f55e9471bb38c23a4657076e76997855ead /libs/common
parent3f32c13d5ac9159978556bc3fcfd73f39b4e218d (diff)
downloadlibrebootfr-f1c378c027db012956d5e8a9585004250550d581.tar.gz
librebootfr-f1c378c027db012956d5e8a9585004250550d581.zip
Added functions for downloading/patching archives
i.e., source tarballs are (partially) supported
Diffstat (limited to 'libs/common')
-rwxr-xr-xlibs/common18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/common b/libs/common
index d0fd1203..c5c89483 100755
--- a/libs/common
+++ b/libs/common
@@ -64,6 +64,24 @@ arguments_list() {
done
}
+download_wrapper() {
+ local download_dir="$1"
+ shift
+ local uris=($@)
+
+ # TODO: Add support for curl, in addition
+ # to wget, for compatibility reasons
+ wget_options=(
+ --config=/dev/null
+ --secure-protocol=PFS
+ --directory-prefix="${download_dir}"
+ --continue
+ --
+ )
+
+ wget "${wget_options[@]}" "${uris[@]}"
+}
+
diff_patch_file() {
local repository_path="$1"
local patch_file_path="$2"