From patchwork Tue Apr 2 19:40:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Boettcher X-Patchwork-Id: 233131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id A353B2C015E for ; Wed, 3 Apr 2013 06:40:55 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 82F5A8C726; Tue, 2 Apr 2013 19:40:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id he9rBM6OVPHP; Tue, 2 Apr 2013 19:40:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C81AB8C683; Tue, 2 Apr 2013 19:40:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 213518F7A1 for ; Tue, 2 Apr 2013 19:40:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 899AA8C298 for ; Tue, 2 Apr 2013 19:40:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ucOf8id7T6fb for ; Tue, 2 Apr 2013 19:40:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by whitealder.osuosl.org (Postfix) with ESMTPS id A42A88C32B for ; Tue, 2 Apr 2013 19:40:20 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id a12so840453wgh.33 for ; Tue, 02 Apr 2013 12:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=oTeYymI2z8Oyt46uij1v09fKHkBqgJcmtbGF9EFCoY4=; b=gbtEp+fEXRM/d179RMe8rvyJ4pdqvdeuz9EKyqECkzS6VqXBkg8DZnpQZeN+jU36UY rRrsdfCZTmLO6JEnu+b6C/ed4jEdheGCJ0YmO677mKKzJq4fWx/SZg29AahnQvEspEey iTRGDKn8xvOA++uyvvNy7b01KEShZlj0SiF0A++EHKFeL4g6MRZ9sTyDg6a/zRo1rIMH vevrK96zjf/YHb0YeK7D7Cecr9UGsHUukWVeOYmToZC7iIA979nPv7pUBNwkByRdeSZk 6+pmMp4PTE/0qGAf9Ffj1DeXlIbxk2lYS5svGw6rBH9AWTCd+B67C2TPYtqc7JwdqxDg obyw== X-Received: by 10.180.72.228 with SMTP id g4mr18381320wiv.22.1364931618929; Tue, 02 Apr 2013 12:40:18 -0700 (PDT) Received: from lappi3.parrot.biz ([78.205.138.52]) by mx.google.com with ESMTPS id dm9sm20868544wib.3.2013.04.02.12.40.17 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 12:40:18 -0700 (PDT) From: Patrick Boettcher To: buildroot@busybox.net Date: Tue, 2 Apr 2013 21:40:09 +0200 Message-Id: <1364931609-2459-2-git-send-email-Patrick.Boettcher@parrot.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364931609-2459-1-git-send-email-Patrick.Boettcher@parrot.com> References: <1364931609-2459-1-git-send-email-Patrick.Boettcher@parrot.com> X-Gm-Message-State: ALoCoQm29BMkG5lrHHVObqChT+Iiar4nz2E3DIRYDKtkHM4nv9XTY43gm8zb0OLo4lQi7B23r8YG Cc: Patrick Boettcher Subject: [Buildroot] [PATCH] pkg-download: take some more care of VERSION when METHOD is git X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net If a package's SITE_METHOD is set to git, but the VERSION is not set it fails to create a tar-ball, this patch is fixes this by always using HEAD as git-archive reference. HEAD will work in both cases: 1) if VERSION is set the clone's HEAD is VERSION, 2) if VERSION is not set the clone's HEAD is the default branch. Signed-off-by: Patrick Boettcher --- package/pkg-download.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 1705fcd..610ceb3 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -77,6 +77,10 @@ domainseparator=$(if $(1),$(1),/) # branch). Before trying to do a shallow clone we check if $($(PKG)_DL_VERSION) # is in the list provided by git ls-remote. If not we fall back on a full clone. # +# In any case we archive HEAD (and not $($(PKG)_DL_VERSION)): if VERSION is not +# set the default branch is checked out and git-archive will fail if no refspec +# is given. HEAD will continue to work if VERSION is set. +# # Messages for the type of clone used are provided to ease debugging in case of # problems define DOWNLOAD_GIT @@ -88,7 +92,7 @@ define DOWNLOAD_GIT (echo "Doing full clone" && \ $(GIT) clone --bare $($(PKG)_SITE) $($(PKG)_BASE_NAME))) && \ pushd $($(PKG)_BASE_NAME) > /dev/null && \ - $(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ $($(PKG)_DL_VERSION) | \ + $(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ HEAD | \ gzip -c > $(DL_DIR)/$($(PKG)_SOURCE) && \ popd > /dev/null && \ rm -rf $($(PKG)_DL_DIR) && \