[Buildroot] [PATCH] fetch/git: Allow fetching from git using ssh
Thomas De Schampheleire
patrickdepinguin+buildroot at gmail.com
Wed Jul 27 05:58:01 UTC 2011
Hi Cory,
On Tue, Jul 26, 2011 at 9:17 PM, Cory Fields
<FOSS at atlastechnologiesinc.com> wrote:
> My apologies for not doing a proper git-send-email, my git install is
> somewhat broken at the moment. See attached.
>
> The patch is against the 2011.02 branch, but it's very simple and
> should be easy enough to apply to master.
Copying here for convenience:
> [PATCH] fetch/git: Allow fetching from git using ssh://
>
> This is especially useful for private repositories. For example,
> github allows fetching from ssh:// git:// and https://. However, for
> private repos (due to the need to authenticate) only https and ssh are
> allowed. The protocol is transparent as far as git is concerned. For
> now, just assume any ssh:// URI is a git repository. Since we would
> just fallback to wget anyway, this should be a safe assumption
I don't think this is a safe assumption. Also other version control
systems allow ssh URLs, at least Mercurial does. By hardcoding ssh ->
git, you break these other version control systems.
But why do you need this patch at all?
If you explicitly specify <PACKAGE>_SITE_METHOD to git, you can pass
in an ssh url without problem.
Have you tried that?
>
> Signed-off-by: Cory Fields <foss at atlastechnologiesinc.com>
> ---
> package/Makefile.package.in | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/package/Makefile.package.in b/package/Makefile.package.in
> index 92ce4e2..1936786 100644
> --- a/package/Makefile.package.in
> +++ b/package/Makefile.package.in
> @@ -189,7 +189,7 @@ define DOWNLOAD
> fi ; \
> if test -n "$(1)" ; then \
> case "$($(PKG)_SITE_METHOD)" in \
> - git) $($(DL_MODE)_GIT) && exit ;; \
> + git | ssh) $($(DL_MODE)_GIT) && exit ;; \
> svn) $($(DL_MODE)_SVN) && exit ;; \
> bzr) $($(DL_MODE)_BZR) && exit ;; \
> *) $(call $(DL_MODE)_WGET,$(1),$(2)) && exit ;; \
> @@ -511,6 +511,8 @@ ifeq ($$($(2)_SITE_METHOD),svn)
> DL_TOOLS_DEPENDENCIES += svn
> else ifeq ($$($(2)_SITE_METHOD),git)
> DL_TOOLS_DEPENDENCIES += git
> +else ifeq ($$($(2)_SITE_METHOD),ssh)
> +DL_TOOLS_DEPENDENCIES += git
> else ifeq ($$($(2)_SITE_METHOD),bzr)
> DL_TOOLS_DEPENDENCIES += bzr
> endif # SITE_METHOD
> --
> 1.7.3.4
Best regards,
Thomas
More information about the buildroot
mailing list