[Buildroot] [PATCH] git-download: Fix downloading of specific revisions from github.

Arnout Vandecappelle arnout at mind.be
Tue Jun 26 21:38:18 UTC 2018



On 26-06-18 11:36, Sven Neumann wrote:
> From: Oliver Tappe <zooey at hirschkaefer.de>
> 
> Github has recently dropped support for the archive-URLs that we
> used to use.

 Could you explain what exactly fails? I tried existing packages and your new
wampcc with the old pattern, and it just works (same hash).


> They do provide another URL where archives can be fetched from, but
> not as git shallow clone, but direcly as tarball.

 AFAIK there never was any specific URL from which you could get a shallow
clone, just the archive URL or the plain (git-over-https) URL (which would allow
shallow clones for tags).

> Adjust the URL to
> be used and adjust the git download script to use wget when trying
> to download from github.
> 
> Signed-off-by: Oliver Tappe <zooey at hirschkaefer.de>
> Signed-off-by: Sven Neumann <neumann at teufel.de>
> ---
>  package/pkg-download.mk | 2 +-
>  support/download/git    | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/package/pkg-download.mk b/package/pkg-download.mk
> index 2ca6ccf44d..2e3b734f97 100644
> --- a/package/pkg-download.mk
> +++ b/package/pkg-download.mk
> @@ -56,7 +56,7 @@ notdomain = $(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$
>  domainseparator = $(if $(1),$(1),/)
>  
>  # github(user,package,version): returns site of GitHub repository
> -github = https://github.com/$(1)/$(2)/archive/$(3)
> +github = https://api.github.com/repos/$(1)/$(2)/tarball/$(3)

 This actually gives me a 404 for the wampcc package...

 Regards,
 Arnout


>  
>  # Expressly do not check hashes for those files
>  # Exported variables default to immediately expanded in some versions of
> diff --git a/support/download/git b/support/download/git
> index 11bb52c1e1..1efde4fcdc 100755
> --- a/support/download/git
> +++ b/support/download/git
> @@ -75,6 +75,12 @@ _git() {
>      eval GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
>  }
>  
> +# If the URL contains github, simply fetch the archive via wget:
> +if [[ $repo == https://api.github.com/* ]]; then
> +    wget -O $output $repo
> +    exit 0
> +fi
> +
>  # Create a warning file, that the user should not use the git cache.
>  # It's ours. Our precious.
>  cat <<-_EOF_ >"${dl_dir}/git.readme"
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


More information about the buildroot mailing list