From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv3 6/7] support/download/scp: implement source-check
Date: Sat, 9 Feb 2019 21:23:48 +0100 [thread overview]
Message-ID: <20190209202350.4984-6-patrickdepinguin@gmail.com> (raw)
In-Reply-To: <20190209202350.4984-1-patrickdepinguin@gmail.com>
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
support/download/scp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
v3: no changes
diff --git a/support/download/scp b/support/download/scp
index 80cf495c4e..d81952956c 100755
--- a/support/download/scp
+++ b/support/download/scp
@@ -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 URI Download file at URI.
#
# 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,8 +36,19 @@ shift $((OPTIND-1)) # Get rid of our options
_scp() {
eval ${SCP} "${@}"
}
+_ssh() {
+ eval ${SSH} "${@}"
+}
# Remove any scheme prefix
uri="${uri##scp://}"
+if [ -n "${checkonly}" ]; then
+ # uri now looks like: foo.example.org:some/directory
+ domain="${uri%%:*}"
+ path="${uri#*:}/${filename}"
+ _ssh ${verbose} "${@}" "'${domain}'" ls "'${path}'" > /dev/null
+ exit ${?}
+fi
+
_scp ${verbose} "${@}" "'${uri}/${filename}'" "'${output}'"
--
2.19.2
next prev parent reply other threads:[~2019-02-09 20:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 20:23 [Buildroot] [PATCHv3 1/7] support/download: reintroduce 'source-check' target Thomas De Schampheleire
2019-02-09 20:23 ` [Buildroot] [PATCHv3 2/7] support/download/hg: implement source-check Thomas De Schampheleire
2019-02-09 21:53 ` Yann E. MORIN
2019-02-15 19:10 ` Thomas De Schampheleire
2019-02-09 20:23 ` [Buildroot] [PATCHv3 3/7] support/download/wget: " Thomas De Schampheleire
2019-02-09 20:23 ` [Buildroot] [PATCHv3 4/7] support/download/file: " Thomas De Schampheleire
2019-02-09 20:23 ` [Buildroot] [PATCHv3 5/7] Config.in: reintroduce BR2_SSH Thomas De Schampheleire
2019-02-09 20:23 ` Thomas De Schampheleire [this message]
2019-02-09 22:09 ` [Buildroot] [PATCHv3 6/7] support/download/scp: implement source-check Yann E. MORIN
2019-02-15 19:15 ` Thomas De Schampheleire
2019-02-15 21:00 ` Thomas De Schampheleire
2019-02-09 20:23 ` [Buildroot] [PATCHv3 7/7] support/download/{bzr, cvs, git, svn}: highlight unimplemented source-check Thomas De Schampheleire
2019-02-09 22:13 ` Yann E. MORIN
2019-02-15 19:15 ` Thomas De Schampheleire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190209202350.4984-6-patrickdepinguin@gmail.com \
--to=patrickdepinguin@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox