@@ -136,6 +136,10 @@ config BR2_SCP
string "Secure copy (scp) command"
default "scp"
+config BR2_SSH
+ string "Secure shell (ssh) command"
+ default "ssh"
+
config BR2_HG
string "Mercurial (hg) command"
default "hg"
@@ -15,6 +15,7 @@ export BZR := $(call qstrip,$(BR2_BZR))
export GIT := $(call qstrip,$(BR2_GIT))
export HG := $(call qstrip,$(BR2_HG))
export SCP := $(call qstrip,$(BR2_SCP))
+export SSH := $(call qstrip,$(BR2_SSH))
export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
DL_WRAPPER = support/download/dl-wrapper
@@ -7,17 +7,20 @@ set -e
#
# Options:
# -q Be quiet.
+# -C Only check that the file exists remotely
# -o FILE Copy to local file FILE.
# -f FILE Copy from remote file FILE.
# -u URL Download file at URL.
#
# Environment:
# SCP : the scp command to call
+# SSH : the ssh command to use for checkonly
verbose=
while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
case "${OPT}" in
q) verbose=-q;;
+ C) checkonly=1;;
o) output="${OPTARG}";;
f) filename="${OPTARG}";;
u) uri="${OPTARG}";;
@@ -33,6 +36,16 @@ shift $((OPTIND-1)) # Get rid of our options
_scp() {
eval ${SCP} "${@}"
}
+_ssh() {
+ eval ${SSH} "${@}"
+}
+
+if [ -n "${checkonly}" ]; then
+ domain="${uri%%:*}"
+ path="${uri#*:}"
+ _ssh ${verbose} "${@}" "'${domain}'" ls "'${path}'" > /dev/null
+ exit ${?}
+fi
# Remove any scheme prefix
uri="${uri##scp://}"