Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jezz@sysmic.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/5] pkg-generic: provide an option to use git archives
Date: Thu, 19 Nov 2015 11:36:05 +0100	[thread overview]
Message-ID: <1447929366-8972-5-git-send-email-jezz@sysmic.org> (raw)
In-Reply-To: <1447929366-8972-1-git-send-email-jezz@sysmic.org>

Note: In order to make this work, $(2)_SITE_METHOD must be set before
$(2)_SOURCE

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 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)
-- 
2.1.4

  parent reply	other threads:[~2015-11-19 10:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 10:36 [Buildroot] [PATCH 0/5] Introduce alternative archive format Jérôme Pouiller
2015-11-19 10:36 ` [Buildroot] [PATCH 1/5] pkg-download: do not test SITE_METHOD Jérôme Pouiller
2015-11-29 17:57   ` Yann E. MORIN
2015-12-18  9:08   ` Thomas Petazzoni
2015-11-19 10:36 ` [Buildroot] [PATCH 2/5] download/git: allow to create archives containing shallowed git repos Jérôme Pouiller
2015-11-19 10:36 ` [Buildroot] [PATCH 3/5] pkg-generic: allow to populate build directory from a git archive Jérôme Pouiller
2015-11-19 10:36 ` Jérôme Pouiller [this message]
2015-11-19 10:36 ` [Buildroot] [PATCH 5/5] pkg-generic: tag sources if git is used Jérôme Pouiller
2015-11-19 12:02 ` [Buildroot] [PATCH 0/5] Introduce alternative archive format Thomas Petazzoni
2015-11-23  9:54   ` Jérôme Pouiller
2015-11-29 18:02   ` Yann E. MORIN
2015-11-30 12:32     ` Jérôme Pouiller
2015-11-29 21:05 ` Arnout Vandecappelle
2015-12-29 21:36 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447929366-8972-5-git-send-email-jezz@sysmic.org \
    --to=jezz@sysmic.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox