Commit 5aac6828 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: add support for EGET_BACKEND=curl

parent e6d816c3
...@@ -313,8 +313,8 @@ Options: ...@@ -313,8 +313,8 @@ Options:
Supported URLs: Supported URLs:
ftp:// http:// https:// file:/ ipfs:// ftp:// http:// https:// file:/ ipfs://
Supported backends: Supported backends (set like EGET_BACKEND=curl)
wget curl ipfs (todo: aria2c) wget curl (todo: aria2c)
Examples: Examples:
$ eget http://ftp.somesite.ru/package-*.x64.tar $ eget http://ftp.somesite.ru/package-*.x64.tar
...@@ -626,7 +626,7 @@ fi ...@@ -626,7 +626,7 @@ fi
WGET="$(print_command_path wget)" WGET="$(print_command_path wget)"
CURL="$(print_command_path curl)"
if is_fileurl "$1" ; then if is_fileurl "$1" ; then
...@@ -710,7 +710,8 @@ url_get_real_url() ...@@ -710,7 +710,8 @@ url_get_real_url()
} }
elif [ -n "$WGET" ] && [ "$EGET_BACKEND" != "curl" ] ; then elif [ -n "$WGET" ] && [ "$EGET_BACKEND" != "curl" ] || [ "$EGET_BACKEND" = "wget" ] ; then
[ -n "$WGET" ] || fatal "There are no wget in the system but you forced using it via EGET_BACKEND. Install it with $ epm install wget"
__wget() __wget()
{ {
if [ -n "$WGETUSERAGENT" ] ; then if [ -n "$WGETUSERAGENT" ] ; then
...@@ -799,9 +800,8 @@ url_get_filename() ...@@ -799,9 +800,8 @@ url_get_filename()
} }
else elif [ -n "$CURL" ] && [ "$EGET_BACKEND" != "wget" ] || [ "$EGET_BACKEND" = "curl" ] ; then
CURL="$(print_command_path curl)" [ -n "$CURL" ] || fatal "There are no curl in the system but you forced using it via EGET_BACKEND. Install it with $ epm install curl"
[ -n "$CURL" ] || fatal "There are no wget nor curl in the system. Install it with $ epm install curl"
__curl() __curl()
{ {
if [ -n "$CURLUSERAGENT" ] ; then if [ -n "$CURLUSERAGENT" ] ; then
...@@ -887,7 +887,8 @@ url_get_filename() ...@@ -887,7 +887,8 @@ url_get_filename()
basename "$(url_get_real_url "$URL")" basename "$(url_get_real_url "$URL")"
} }
else
fatal "There are no wget nor curl in the system. Install something with $ epm install wget"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment