From fcf2d188965c3e27fd0b49f049711d2ff1d14d2d Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 19 Oct 2007 09:59:23 +0000 Subject: * Add support for ssh:/// URLs (thanks, Steffen Joeris; closes: #434893). r49820 --- debian/changelog | 1 + debootstrap.8 | 11 ++++++++--- functions | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5b5b419..673e093 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ debootstrap (1.0.4) UNRELEASED; urgency=low * Unmount /lib/init/rw on exit (closes: #391604). * Cope if uncompressed Packages is missing from Release (closes: #402380). * Don't rely on XSI test(1) extensions. + * Add support for ssh:/// URLs (thanks, Steffen Joeris; closes: #434893). -- Otavio Salvador Tue, 16 Oct 2007 16:47:55 -0200 diff --git a/debootstrap.8 b/debootstrap.8 index e0e2cfe..6fee6cb 100644 --- a/debootstrap.8 +++ b/debootstrap.8 @@ -22,9 +22,14 @@ from by running .IR SCRIPT . .I MIRROR -can be an http:// URL or a file:/// URL. Notice that file:/ URLs are -translated to file:/// (correct scheme as described in RFC1738 for local filenames), -and file:// will \fBnot\fR work. +can be an http:// URL, a file:/// URL, or an ssh:/// URL. +Notice that file:/ URLs are translated to file:/// (correct scheme as +described in RFC1738 for local filenames), and file:// will \fBnot\fR work. +ssh://USER@HOST/PATH URLs are retrieved using +.BR scp ; +use of +.B ssh\-agent +or similar is strongly recommended. .PP \fBDebootstrap\fR can be used to install Debian in a system without using an installation disk but can also be used to run a different Debian flavor in a \fBchroot\fR diff --git a/functions b/functions index 5175cfd..980e0d5 100644 --- a/functions +++ b/functions @@ -351,6 +351,14 @@ just_get () { else return 1 fi + elif [ "${from#ssh:}" != "$from" ]; then + local ssh_dest="$(echo $from | sed -e 's#ssh://##' -e 's#/#:/#')" + if [ -n "$ssh_dest" ]; then + scp "$ssh_dest" "$dest" + return 0 + else + return 1 + fi else error 1 UNKNOWNLOC "unknown location %s" "$from" fi -- cgit v0.12