From patchwork Thu Nov 19 10:36:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 546381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id D061A141491 for ; Thu, 19 Nov 2015 21:36:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C0D0E94BA4; Thu, 19 Nov 2015 10:36:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2rQfyXrDwI2l; Thu, 19 Nov 2015 10:36:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3C2DE94B7D; Thu, 19 Nov 2015 10:36:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D43F61CF3E5 for ; Thu, 19 Nov 2015 10:36:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CF78F8BF67 for ; Thu, 19 Nov 2015 10:36:24 +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 cV+R3eiplj5y for ; Thu, 19 Nov 2015 10:36:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6B2A18BF69 for ; Thu, 19 Nov 2015 10:36:23 +0000 (UTC) Received: from localhost.localdomain (unknown [212.234.226.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id B27BB42F4E; Thu, 19 Nov 2015 11:36:21 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Thu, 19 Nov 2015 11:36:05 +0100 Message-Id: <1447929366-8972-5-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447929366-8972-1-git-send-email-jezz@sysmic.org> References: <1447929366-8972-1-git-send-email-jezz@sysmic.org> MIME-Version: 1.0 Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH 4/5] pkg-generic: provide an option to use git archives X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Note: In order to make this work, $(2)_SITE_METHOD must be set before $(2)_SOURCE Signed-off-by: Jérôme Pouiller --- Config.in | 13 +++++++++++++ package/pkg-generic.mk | 36 ++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/Config.in b/Config.in index d795361..6b9482c 100644 --- a/Config.in +++ b/Config.in @@ -158,6 +158,19 @@ config BR2_HOST_DIR menu "Mirrors and Download locations" +config BR2_USE_GIT_ARCHIVES + bool "Place git repository in archives" + help + In case a package use a git repository as source. Enabling this + option will archive (shallowed) bare git repository instead of plain + files. In order to distinguish these archives from classical ones, + their names end with .git.tar.gz. + + Enable this option if you work with upstream and are interrested to + have a better workflow with upstream team. Notice archive generation + is about 25% slower and archives are 20 to 50% bigger. Time to extract + archives are identical with or without this option. + config BR2_PRIMARY_SITE string "Primary download site" default "" diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 846d8e9..30155a6 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -412,11 +412,30 @@ ifneq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_VERSION = custom endif +ifndef $(2)_SITE + ifdef $(3)_SITE + $(2)_SITE = $$($(3)_SITE) + endif +endif + +ifndef $(2)_SITE_METHOD + ifdef $(3)_SITE_METHOD + $(2)_SITE_METHOD = $$($(3)_SITE_METHOD) + else + # Try automatic detection using the scheme part of the URI + $(2)_SITE_METHOD = $$(call geturischeme,$$($(2)_SITE)) + endif +endif + ifndef $(2)_SOURCE ifdef $(3)_SOURCE $(2)_SOURCE = $$($(3)_SOURCE) else - $(2)_SOURCE ?= $$($(2)_RAWNAME)-$$($(2)_VERSION).tar.gz + ifeq ($(BR2_USE_GIT_ARCHIVES)$$($(2)_SITE_METHOD),ygit) + $(2)_SOURCE ?= $$($(2)_RAWNAME)-$$($(2)_VERSION).git.tar.gz + else + $(2)_SOURCE ?= $$($(2)_RAWNAME)-$$($(2)_VERSION).tar.gz + endif endif endif @@ -431,21 +450,6 @@ $(2)_ALL_DOWNLOADS = \ $$(if $$(findstring ://,$$(p)),$$(p),\ $$($(2)_SITE)/$$(p))) -ifndef $(2)_SITE - ifdef $(3)_SITE - $(2)_SITE = $$($(3)_SITE) - endif -endif - -ifndef $(2)_SITE_METHOD - ifdef $(3)_SITE_METHOD - $(2)_SITE_METHOD = $$($(3)_SITE_METHOD) - else - # Try automatic detection using the scheme part of the URI - $(2)_SITE_METHOD = $$(call geturischeme,$$($(2)_SITE)) - endif -endif - ifeq ($$($(2)_SITE_METHOD),local) ifeq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE)