@@ -26,6 +26,8 @@ repo="${2}"
rev="${3}"
basename="${4}"
+shift 4 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_bzr() {
@@ -49,5 +51,5 @@ if [ ${bzr_version} -ge ${bzr_min_version} ]; then
fi
_bzr export ${verbose} --root="'${basename}/'" --format=tgz \
- ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
+ ${timestamp_opt} - "${@}" "'${repo}'" -r "'${rev}'" \
>"${output}"
@@ -28,10 +28,12 @@ shift $((OPTIND-1))
output="${1}"
source="${2}"
+shift 2 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_localfiles() {
eval ${LOCALFILES} "${@}"
}
-_localfiles ${verbose} "'${source}'" "'${output}'"
+_localfiles ${verbose} "${@}""'${source}'" "'${output}'"
@@ -26,6 +26,8 @@ rev="${3}"
rawname="${4}"
basename="${5}"
+shift 5 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_cvs() {
@@ -48,6 +50,6 @@ fi
export TZ=UTC
_cvs ${verbose} -z3 -d"'${repo}'" \
- co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
+ co "${@}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
tar czf "${output}" "${basename}"
@@ -25,6 +25,8 @@ repo="${2}"
cset="${3}"
basename="${4}"
+shift 4 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_git() {
@@ -49,7 +51,7 @@ if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
fi
if [ ${git_done} -eq 0 ]; then
printf "Doing full clone\n"
- _git clone ${verbose} --mirror "'${repo}'" "'${basename}'"
+ _git clone ${verbose} "${@}" --mirror "'${repo}'" "'${basename}'"
fi
GIT_DIR="${basename}" \
@@ -25,13 +25,15 @@ repo="${2}"
cset="${3}"
basename="${4}"
+shift 4 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_hg() {
eval ${HG} "${@}"
}
-_hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
+_hg clone ${verbose} "${@}" --noupdate "'${repo}'" "'${basename}'"
_hg archive ${verbose} --repository "'${basename}'" --type tgz \
--prefix "'${basename}'" --rev "'${cset}'" \
@@ -23,10 +23,12 @@ shift $((OPTIND-1))
output="${1}"
url="${2}"
+shift 2 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_scp() {
eval ${SCP} "${@}"
}
-_scp ${verbose} "'${url}'" "'${output}'"
+_scp ${verbose} "${@}" "'${url}'" "'${output}'"
@@ -25,12 +25,14 @@ repo="${2}"
rev="${3}"
basename="${4}"
+shift 4 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_svn() {
eval ${SVN} "${@}"
}
-_svn export ${verbose} "'${repo}@${rev}'" "'${basename}'"
+_svn export ${verbose} "${@}" "'${repo}@${rev}'" "'${basename}'"
tar czf "${output}" "${basename}"
@@ -23,10 +23,12 @@ shift $((OPTIND-1))
output="${1}"
url="${2}"
+shift 2 # Get rid of our options
+
# Caller needs to single-quote its arguments to prevent them from
# being expanded a second time (in case there are spaces in them)
_wget() {
eval ${WGET} "${@}"
}
-_wget ${verbose} -O "'${output}'" "'${url}'"
+_wget ${verbose} "${@}" -O "'${output}'" "'${url}'"
This adds support to pass options to the underlying command that is used by downloader. Useful for retrieving data with server-side checking for user login or passwords, use a proxy or use specific options for cloning a repository via git and hg. Signed-off-by: Romain Perier <romain.perier@free-electrons.com> --- Changes in v3: - Don't use the variable ${dl_opts} to catch extra arguments - We prefer to use shift and "${@}", it does not introduce empty string when there are no extra parameters. Changes in v2: - Replaced the variable $(PKG)_DL_REFERER by $(PKG)_DL_OPTS - Add modification to all downloaders support/download/bzr | 4 +++- support/download/cp | 4 +++- support/download/cvs | 4 +++- support/download/git | 4 +++- support/download/hg | 4 +++- support/download/scp | 4 +++- support/download/svn | 4 +++- support/download/wget | 4 +++- 8 files changed, 24 insertions(+), 8 deletions(-)