Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
@ 2010-07-12 21:30 Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 1/5] packages: pass the package name to the DOWNLOAD macro Luca Ceresoli
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

Hi,

this patchset is a tentative generalization of the DOWNLOAD macro, as
recently discussed in mailing-list, in order to allow BR to obtain
package sources not only as tar files from http/ftp, but also using
other protocols.

I borrowed some pieces of code from Quotient Remainder's patch, but this
approach is substiatially different.

The feature list is short: I deliberately wanted to be minimalistic
but set up a clean infrastructure that can be extended later.

Even though these patches are quite polished, please consider them as
a proposal for discussion. If there is general consensus about the way
I propose, I'll be glad to add a bit of user documentation as well.

In the first two patches I prepare the ground by making the download
infrastructure more general. The DOWNLOAD function is replaced by a
per-package $(PKG)_DOWNLOAD, whose value is computed automatically
from the site URL but can be overridden. The good old wget system is
modified to fit in the new framework.

In the third and fourth commit I add DOWNLOAD_GIT, which is relatively
straightforward given the whole infrastructure is already in place.
The place where the repository should be cloned might not be appreciated,
but I definitely think it should go in output/, as it is part of
buildroot's -well- output, not of the package "recipe".

The last patch is surely *not* meant to be committed. It's just a
minimalistic example of a package downloaded via Git, and would be
replaced by user docs as stated above.

Luca

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/5] packages: pass the package name to the DOWNLOAD macro
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
@ 2010-07-12 21:30 ` Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection Luca Ceresoli
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

This enables DOWNLOAD to have a more complex behaviour than it currently can.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/Makefile.package.in |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index c476de9..8243ed5 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -76,6 +76,7 @@ TERM_RESET := $(shell tput rmso)
 #
 # Argument 1 is the source location
 # Argument 2 is the source filename
+# Argument 3 is the uppercase package name
 #
 # E.G. use like this:
 # $(call DOWNLOAD,$(FOO_SITE),$(FOO_SOURCE))
@@ -124,7 +125,7 @@ ifeq ($(SPIDER),)
 		(test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
 		$(call MESSAGE,"Downloading")
 endif
-	$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE))
+	$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE),$(PKG))
 	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
 ifeq ($(SPIDER),)
 	$(Q)mkdir -p $(@D)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 1/5] packages: pass the package name to the DOWNLOAD macro Luca Ceresoli
@ 2010-07-12 21:30 ` Luca Ceresoli
  2010-07-12 21:42   ` Michael S. Zick
  2010-07-12 21:30 ` [Buildroot] [PATCH 3/5] Unleash all of git's power: not only clones Luca Ceresoli
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

Map the DOWNLOAD macro to a different specialized macro based on the URL.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/Makefile.package.in |   46 +++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index 8243ed5..a212a38 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -69,30 +69,39 @@ TERM_BOLD := $(shell tput smso)
 TERM_RESET := $(shell tput rmso)
 
 ################################################################################
-# DOWNLOAD -- Download helper. Will try to download source from:
-# 1) BR2_PRIMARY_SITE if enabled
-# 2) Download site
-# 3) BR2_BACKUP_SITE if enabled
-#
+# Download helpers.
+# Different download protocols are supported, and each has a helper function
+# named DOWNLAOD_$(PROTOCOL_NAME) taking three arguments:
 # Argument 1 is the source location
 # Argument 2 is the source filename
 # Argument 3 is the uppercase package name
 #
 # E.G. use like this:
-# $(call DOWNLOAD,$(FOO_SITE),$(FOO_SOURCE))
+# $(call DOWNLOAD_WGET,$(FOO_SITE),$(FOO_SOURCE),FOO)
 ################################################################################
 
+# $(call DOWNLOAD_WGET,$(PKG_SITE),$(PKG_SOURCE),irrelevant)
+# Will try to download source from:
+# 1) BR2_PRIMARY_SITE if enabled
+# 2) Download site specified in $(PKG)_SITE
+# 3) BR2_BACKUP_SITE if enabled
+
 # support make source-check/external-deps
 ifneq ($(SPIDER),)
-DOWNLOAD=$(WGET) -P $(DL_DIR) $(1)/$(2)
+DOWNLOAD_WGET=$(WGET) -P $(DL_DIR) $(1)/$(2)
 else
-define DOWNLOAD
+define DOWNLOAD_WGET
 	$(Q)test -e $(DL_DIR)/$(2) || \
 	for site in $(call qstrip,$(BR2_PRIMARY_SITE)) $(1) $(call qstrip,$(BR2_BACKUP_SITE)); \
 	do $(WGET) -P $(DL_DIR) $$site/$(2) && exit; done
-endef
+endef # DOWNLOAD_WGET
 endif
 
+# Use wget for ftp://, http:// and https://.
+DOWNLOAD_FTP=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
+DOWNLOAD_HTTP=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
+DOWNLOAD_HTTPS=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
+
 # Utility programs used to build packages
 TAR ?= tar
 
@@ -123,10 +132,10 @@ ifeq ($(SPIDER),)
 # Only show the download message if it isn't already downloaded
 	$(Q)(test -e $(DL_DIR)/$($(PKG)_SOURCE) && \
 		(test -z $($(PKG)_PATCH) || test -e $(DL_DIR)$($(PKG)_PATCH))) || \
-		$(call MESSAGE,"Downloading")
+		$(call MESSAGE,"Downloading via $($(PKG)_DOWNLOAD_PROTOCOL)")
 endif
-	$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_SOURCE),$(PKG))
-	$(if $($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE),$($(PKG)_PATCH)))
+	$(call $($(PKG)_DOWNLOAD),$($(PKG)_SITE),$($(PKG)_SOURCE),$(PKG))
+	$(if $($(PKG)_PATCH),$(call $($(PKG)_DOWNLOAD),$($(PKG)_SITE),$($(PKG)_PATCH)))
 ifeq ($(SPIDER),)
 	$(Q)mkdir -p $(@D)
 	$(Q)touch $@
@@ -280,6 +289,19 @@ ifndef $(2)_SITE
  endif
 endif
 
+ifndef $(2)_DOWNLOAD_PROTOCOL
+ ifdef $(3)_DOWNLOAD_PROTOCOL
+  # use user-provided protocol
+  $(2)_DOWNLOAD_PROTOCOL := $($(3)_DOWNLOAD_PROTOCOL)
+ else
+  # Try automatic detection: use the protocol part of the URL to decide
+  # which download utility to use.
+  $(2)_DOWNLOAD_PROTOCOL	:= \
+   $(call UPPERCASE,$(firstword $(subst ://, ,$(call qstrip,$($(2)_SITE)))))
+ endif
+endif
+
+$(2)_DOWNLOAD			?= DOWNLOAD_$$($(2)_DOWNLOAD_PROTOCOL)
 $(2)_DEPENDENCIES		?=
 $(2)_INSTALL_STAGING		?= NO
 $(2)_INSTALL_TARGET		?= YES
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 3/5] Unleash all of git's power: not only clones
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 1/5] packages: pass the package name to the DOWNLOAD macro Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection Luca Ceresoli
@ 2010-07-12 21:30 ` Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 4/5] packages: add DOWNLOAD_GIT Luca Ceresoli
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 Config.in                                 |    4 ++--
 configs/arm_toolchain_defconfig           |    2 +-
 configs/at91rm9200df_defconfig            |    2 +-
 configs/at91rm9200df_ext_bare_defconfig   |    2 +-
 configs/at91rm9200df_ext_defconfig        |    2 +-
 configs/at91sam9260dfc_defconfig          |    2 +-
 configs/at91sam9260dfc_ext_bare_defconfig |    2 +-
 configs/at91sam9260dfc_ext_defconfig      |    2 +-
 configs/at91sam9261ek_defconfig           |    2 +-
 configs/at91sam9261ek_ext_bare_defconfig  |    2 +-
 configs/at91sam9261ek_ext_defconfig       |    2 +-
 configs/at91sam9263ek_defconfig           |    2 +-
 configs/at91sam9263ek_ext_bare_defconfig  |    2 +-
 configs/at91sam9263ek_ext_defconfig       |    2 +-
 configs/at91sam9g20dfc_defconfig          |    2 +-
 configs/at91sam9g20dfc_ext_bare_defconfig |    2 +-
 configs/at91sam9g20dfc_ext_defconfig      |    2 +-
 configs/atngw100-base_defconfig           |    2 +-
 configs/atngw100_defconfig                |    2 +-
 configs/atstk1005_defconfig               |    2 +-
 configs/atstk100x_defconfig               |    2 +-
 configs/i386_defconfig                    |    2 +-
 configs/i686_defconfig                    |    2 +-
 configs/integrator926_defconfig           |    2 +-
 configs/integrator926_huge_defconfig      |    2 +-
 configs/kb9202_defconfig                  |    2 +-
 configs/v100sc2_defconfig                 |    2 +-
 27 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/Config.in b/Config.in
index 6adfe49..8b22c23 100644
--- a/Config.in
+++ b/Config.in
@@ -38,8 +38,8 @@ config BR2_BZR_UP
 	default "bzr up"
 
 config BR2_GIT
-	string "Git command to download source tree"
-	default "git clone"
+	string "Git command"
+	default "git"
 
 config BR2_ZCAT
 	string "zcat command"
diff --git a/configs/arm_toolchain_defconfig b/configs/arm_toolchain_defconfig
index 4c1e2c2..602e271 100644
--- a/configs/arm_toolchain_defconfig
+++ b/configs/arm_toolchain_defconfig
@@ -133,7 +133,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91rm9200df_defconfig b/configs/at91rm9200df_defconfig
index 0d453b6..4fd633b 100644
--- a/configs/at91rm9200df_defconfig
+++ b/configs/at91rm9200df_defconfig
@@ -138,7 +138,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91rm9200df_ext_bare_defconfig b/configs/at91rm9200df_ext_bare_defconfig
index 1622cc7..a333acf 100644
--- a/configs/at91rm9200df_ext_bare_defconfig
+++ b/configs/at91rm9200df_ext_bare_defconfig
@@ -133,7 +133,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91rm9200df_ext_defconfig b/configs/at91rm9200df_ext_defconfig
index 7245b8a..3667205 100644
--- a/configs/at91rm9200df_ext_defconfig
+++ b/configs/at91rm9200df_ext_defconfig
@@ -144,7 +144,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9260dfc_defconfig b/configs/at91sam9260dfc_defconfig
index 3de2aea..fbb72b4 100644
--- a/configs/at91sam9260dfc_defconfig
+++ b/configs/at91sam9260dfc_defconfig
@@ -151,7 +151,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9260dfc_ext_bare_defconfig b/configs/at91sam9260dfc_ext_bare_defconfig
index f1939cc..cd4020b 100644
--- a/configs/at91sam9260dfc_ext_bare_defconfig
+++ b/configs/at91sam9260dfc_ext_bare_defconfig
@@ -133,7 +133,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9260dfc_ext_defconfig b/configs/at91sam9260dfc_ext_defconfig
index e66a541..d1c4e57 100644
--- a/configs/at91sam9260dfc_ext_defconfig
+++ b/configs/at91sam9260dfc_ext_defconfig
@@ -152,7 +152,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9261ek_defconfig b/configs/at91sam9261ek_defconfig
index b8b5d60..a17ec0b 100644
--- a/configs/at91sam9261ek_defconfig
+++ b/configs/at91sam9261ek_defconfig
@@ -154,7 +154,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9261ek_ext_bare_defconfig b/configs/at91sam9261ek_ext_bare_defconfig
index e116f44..30b4c69 100644
--- a/configs/at91sam9261ek_ext_bare_defconfig
+++ b/configs/at91sam9261ek_ext_bare_defconfig
@@ -136,7 +136,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9261ek_ext_defconfig b/configs/at91sam9261ek_ext_defconfig
index 7e0e84f..7e80c0f 100644
--- a/configs/at91sam9261ek_ext_defconfig
+++ b/configs/at91sam9261ek_ext_defconfig
@@ -155,7 +155,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9263ek_defconfig b/configs/at91sam9263ek_defconfig
index de2a12d..05f0366 100644
--- a/configs/at91sam9263ek_defconfig
+++ b/configs/at91sam9263ek_defconfig
@@ -152,7 +152,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9263ek_ext_bare_defconfig b/configs/at91sam9263ek_ext_bare_defconfig
index 4efc758..4b1c716 100644
--- a/configs/at91sam9263ek_ext_bare_defconfig
+++ b/configs/at91sam9263ek_ext_bare_defconfig
@@ -135,7 +135,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9263ek_ext_defconfig b/configs/at91sam9263ek_ext_defconfig
index d757aaa..e3cecf4 100644
--- a/configs/at91sam9263ek_ext_defconfig
+++ b/configs/at91sam9263ek_ext_defconfig
@@ -154,7 +154,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9g20dfc_defconfig b/configs/at91sam9g20dfc_defconfig
index ffe4636..3108550 100644
--- a/configs/at91sam9g20dfc_defconfig
+++ b/configs/at91sam9g20dfc_defconfig
@@ -152,7 +152,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9g20dfc_ext_bare_defconfig b/configs/at91sam9g20dfc_ext_bare_defconfig
index 22676b7..ac6273e 100644
--- a/configs/at91sam9g20dfc_ext_bare_defconfig
+++ b/configs/at91sam9g20dfc_ext_bare_defconfig
@@ -133,7 +133,7 @@ BR2_AT91_LINUXPATCH_SITE="http://maxim.org.za/AT91RM9200/2.6"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/at91sam9g20dfc_ext_defconfig b/configs/at91sam9g20dfc_ext_defconfig
index 2cf2839..a9c6d92 100644
--- a/configs/at91sam9g20dfc_ext_defconfig
+++ b/configs/at91sam9g20dfc_ext_defconfig
@@ -152,7 +152,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-arm/kernel-patches-$(BR2_KER
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/atngw100-base_defconfig b/configs/atngw100-base_defconfig
index 8c3d80b..c90dbee 100644
--- a/configs/atngw100-base_defconfig
+++ b/configs/atngw100-base_defconfig
@@ -86,7 +86,7 @@ BR2_TARGET_AVR32_ATNGW100_BASE=y
 BR2_WGET="wget --passive-ftp --retry-connrefused --waitretry=10"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="zcat"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/atngw100_defconfig b/configs/atngw100_defconfig
index 763cad7..9f39fe8 100644
--- a/configs/atngw100_defconfig
+++ b/configs/atngw100_defconfig
@@ -73,7 +73,7 @@ BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
 BR2_BZR_CO="bzr co"
 BR2_BZR_UP="bzr up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="zcat"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/atstk1005_defconfig b/configs/atstk1005_defconfig
index ab8b369..8188a77 100644
--- a/configs/atstk1005_defconfig
+++ b/configs/atstk1005_defconfig
@@ -84,7 +84,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-avr32/kernel-patches-$(BR2_K
 BR2_WGET="wget --passive-ftp --retry-connrefused --waitretry=10"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="zcat"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/atstk100x_defconfig b/configs/atstk100x_defconfig
index 0a718de..96e6e9d 100644
--- a/configs/atstk100x_defconfig
+++ b/configs/atstk100x_defconfig
@@ -85,7 +85,7 @@ BR2_KERNEL_ARCH_PATCH_DIR="target/device/Atmel/arch-avr32/kernel-patches-$(BR2_K
 BR2_WGET="wget --passive-ftp --retry-connrefused --waitretry=10"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="zcat"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/i386_defconfig b/configs/i386_defconfig
index 69e6412..74606ac 100644
--- a/configs/i386_defconfig
+++ b/configs/i386_defconfig
@@ -87,7 +87,7 @@ BR2_TARGET_I686=y
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/i686_defconfig b/configs/i686_defconfig
index e4d4f98..4a4f2b3 100644
--- a/configs/i686_defconfig
+++ b/configs/i686_defconfig
@@ -87,7 +87,7 @@ BR2_TARGET_I686=y
 BR2_WGET="wget --passive-ftp"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/integrator926_defconfig b/configs/integrator926_defconfig
index 815d259..cb5a4e4 100644
--- a/configs/integrator926_defconfig
+++ b/configs/integrator926_defconfig
@@ -83,7 +83,7 @@ BR2_BOARD_PATH="target/device/ARMLTD/$(BR2_BOARD_NAME)"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/integrator926_huge_defconfig b/configs/integrator926_huge_defconfig
index 9b68258..c58a7cb 100644
--- a/configs/integrator926_huge_defconfig
+++ b/configs/integrator926_huge_defconfig
@@ -83,7 +83,7 @@ BR2_BOARD_PATH="target/device/ARMLTD/$(BR2_BOARD_NAME)"
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/kb9202_defconfig b/configs/kb9202_defconfig
index 9300f28..1c22876 100644
--- a/configs/kb9202_defconfig
+++ b/configs/kb9202_defconfig
@@ -94,7 +94,7 @@ BR2_PRIMARY_SITE=""
 BR2_WGET="wget --passive-ftp -nd"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="gzip -d -c"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
diff --git a/configs/v100sc2_defconfig b/configs/v100sc2_defconfig
index c85a4d8..65ddcf6 100644
--- a/configs/v100sc2_defconfig
+++ b/configs/v100sc2_defconfig
@@ -65,7 +65,7 @@ BR2_PRIMARY_SITE=""
 BR2_WGET="wget --passive-ftp --retry-connrefused --waitretry=10"
 BR2_SVN_CO="svn co"
 BR2_SVN_UP="svn up"
-BR2_GIT="git clone"
+BR2_GIT="git"
 BR2_ZCAT="zcat"
 BR2_BZCAT="bzcat"
 BR2_TAR_OPTIONS=""
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 4/5] packages: add DOWNLOAD_GIT
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
                   ` (2 preceding siblings ...)
  2010-07-12 21:30 ` [Buildroot] [PATCH 3/5] Unleash all of git's power: not only clones Luca Ceresoli
@ 2010-07-12 21:30 ` Luca Ceresoli
  2010-07-12 21:30 ` [Buildroot] [PATCH 5/5] FOR TESTING ONLY: Add a GIT-downloaded test package Luca Ceresoli
  2010-07-13 14:43 ` [Buildroot] [PATCH/RFC] Download sources from Git (and more) Quotient Remainder
  5 siblings, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

Allows to download packages directly from git repositories.

The repository is cloned in output/build/$(PKG)_NAME.git/ the first time,
and fetched whenever a download action is required (e.g. because
$(PKG)_VERSION changed in the package .mk file.

Sources are extracted directly from the local clone to
output/build/$(PKG)_NAME-$(PKG)_VERSION/, skipping the usual extract step.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/Makefile.package.in |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index a212a38..0cb3ccc 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -102,6 +102,24 @@ DOWNLOAD_FTP=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
 DOWNLOAD_HTTP=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
 DOWNLOAD_HTTPS=$(call DOWNLOAD_WGET,$(1),$(2),$(3))
 
+# $(call DOWNLOAD_GIT,irrelevant,irrelevant,$(PKG_NAME))
+# Download sources from a Git repository.
+# - Step 1: clone the first time, fetch thereafter, according to the logic:
+#           ( [ local clone exists ] && fetch ) || clone
+# - Step 2: Go to the cloned repo and extract specific version straight
+#           to the build dir
+# - Finally: touch .stamp_extracted in order to skip that step (kind of hack)
+define DOWNLOAD_GIT
+	( [ -d $(BUILD_DIR)/$($(3)_NAME).git/.git ] \
+	    && ( cd $(BUILD_DIR)/$($(3)_NAME).git/.git && $(GIT) fetch) \
+	    || $(GIT) clone --no-checkout $($(3)_SITE) $(BUILD_DIR)/$($(3)_NAME).git )
+	mkdir -p $($(3)_DIR)
+	cd $(BUILD_DIR)/$($(3)_NAME).git && \
+	  git archive --format=tar --prefix=$($(3)_NAME)-$($(3)_VERSION)/ $($(3)_VERSION) | \
+	    $(TAR) -x -C $(BUILD_DIR)
+	touch $($(3)_DIR)/.stamp_extracted
+endef # DOWNLOAD_GIT
+
 # Utility programs used to build packages
 TAR ?= tar
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 5/5] FOR TESTING ONLY: Add a GIT-downloaded test package
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
                   ` (3 preceding siblings ...)
  2010-07-12 21:30 ` [Buildroot] [PATCH 4/5] packages: add DOWNLOAD_GIT Luca Ceresoli
@ 2010-07-12 21:30 ` Luca Ceresoli
  2010-07-13 14:43 ` [Buildroot] [PATCH/RFC] Download sources from Git (and more) Quotient Remainder
  5 siblings, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-12 21:30 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 package/Config.in          |    2 ++
 package/testpkg/Config.in  |    2 ++
 package/testpkg/testpkg.mk |    7 +++++++
 3 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 package/testpkg/Config.in
 create mode 100644 package/testpkg/testpkg.mk

diff --git a/package/Config.in b/package/Config.in
index eba21da..8b7eda2 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -486,4 +486,6 @@ source "package/vim/Config.in"
 endif
 endmenu
 
+source "package/testpkg/Config.in"
+
 endmenu
diff --git a/package/testpkg/Config.in b/package/testpkg/Config.in
new file mode 100644
index 0000000..0802012
--- /dev/null
+++ b/package/testpkg/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_TESTPKG
+	bool "testpkg"
diff --git a/package/testpkg/testpkg.mk b/package/testpkg/testpkg.mk
new file mode 100644
index 0000000..cc1e0f3
--- /dev/null
+++ b/package/testpkg/testpkg.mk
@@ -0,0 +1,7 @@
+# This is a fake package: it only downloads sources.
+
+TESTPKG_SITE=git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/tracker.git
+TESTPKG_VERSION=7f220f1ea
+# TESTPKG_VERSION can also be a tag name.
+
+$(eval $(call GENTARGETS,package,testpkg))
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection
  2010-07-12 21:30 ` [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection Luca Ceresoli
@ 2010-07-12 21:42   ` Michael S. Zick
  0 siblings, 0 replies; 12+ messages in thread
From: Michael S. Zick @ 2010-07-12 21:42 UTC (permalink / raw)
  To: buildroot

On Mon July 12 2010, Luca Ceresoli wrote:
> ?################################################################################
> -# DOWNLOAD -- Download helper. Will try to download source from:
> -# 1) BR2_PRIMARY_SITE if enabled
> -# 2) Download site
> -# 3) BR2_BACKUP_SITE if enabled
> -#
> +# Download helpers.
> +# Different download protocols are supported, and each has a helper function

True name is: "Scheme" not "Protocol" if you mean everything prior to the first ":"

> +# named DOWNLAOD_$(PROTOCOL_NAME) taking three arguments:

DOWNLAOD ??

> ?# Argument 1 is the source location
> ?# Argument 2 is the source filename
> ?# Argument 3 is the uppercase package name
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
  2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
                   ` (4 preceding siblings ...)
  2010-07-12 21:30 ` [Buildroot] [PATCH 5/5] FOR TESTING ONLY: Add a GIT-downloaded test package Luca Ceresoli
@ 2010-07-13 14:43 ` Quotient Remainder
  2010-07-13 18:08   ` Thomas Petazzoni
  2010-07-13 20:14   ` Luca Ceresoli
  5 siblings, 2 replies; 12+ messages in thread
From: Quotient Remainder @ 2010-07-13 14:43 UTC (permalink / raw)
  To: buildroot

Ar Luan, 2010-07-12 ag 23:30 +0200, scr?obh Luca Ceresoli:
> Hi,
> 
> this patchset is a tentative generalization of the DOWNLOAD macro, as
> recently discussed in mailing-list, in order to allow BR to obtain
> package sources not only as tar files from http/ftp, but also using
> other protocols.
> 
> I borrowed some pieces of code from Quotient Remainder's patch, but this
> approach is substiatially different.
> 
> The feature list is short: I deliberately wanted to be minimalistic
> but set up a clean infrastructure that can be extended later.
> 
> Even though these patches are quite polished, please consider them as
> a proposal for discussion. If there is general consensus about the way
> I propose, I'll be glad to add a bit of user documentation as well.
> 
> In the first two patches I prepare the ground by making the download
> infrastructure more general. The DOWNLOAD function is replaced by a
> per-package $(PKG)_DOWNLOAD, whose value is computed automatically
> from the site URL but can be overridden. The good old wget system is
> modified to fit in the new framework.
> 
> In the third and fourth commit I add DOWNLOAD_GIT, which is relatively
> straightforward given the whole infrastructure is already in place.
> The place where the repository should be cloned might not be appreciated,
> but I definitely think it should go in output/, as it is part of
> buildroot's -well- output, not of the package "recipe".
> 
> The last patch is surely *not* meant to be committed. It's just a
> minimalistic example of a package downloaded via Git, and would be
> replaced by user docs as stated above.
> 
> Luca

I personally quite like the approach here and think it's more flexible
than the patch set from Maxime, but have two questions.

 - Why not make the usual tarball in $(DL_DIR) with "git archive
--format=tar ... | gzip > $(DL_DIR)/..." instead of the self-described
"hack" of skipping the extraction step?  I suppose it's slightly faster
since you avoid the compression and decompression time but that mightn't
be too significant.  I just wonder if the skipping of this stage may
have some side effects especially if packages have custom extraction
steps.

 - Do you see any way of making it possible to use the clone as the
actual working copy used by buildroot?  That is, if I clone a repository
(as opposed to archive) and then want to make changes, I can edit the
source and build/test the change in-place (in output/build/package/) .
As it stands with this patch set, I think it would be necessary to make
a change in the source in $(PKG_NAME).git/, commit the change, note the
new version, change the package version in package/Makefile to the same
and make will then copy an entire snapshot to a new
build-dir/pkg-newversion/.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
  2010-07-13 14:43 ` [Buildroot] [PATCH/RFC] Download sources from Git (and more) Quotient Remainder
@ 2010-07-13 18:08   ` Thomas Petazzoni
  2010-07-13 20:49     ` Luca Ceresoli
  2010-07-14 12:28     ` Quotient Remainder
  2010-07-13 20:14   ` Luca Ceresoli
  1 sibling, 2 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2010-07-13 18:08 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 13 Jul 2010 15:43:39 +0100
Quotient Remainder <quotientvremainder@gmail.com> wrote:

>  - Do you see any way of making it possible to use the clone as the
> actual working copy used by buildroot?  That is, if I clone a
> repository (as opposed to archive) and then want to make changes, I
> can edit the source and build/test the change in-place (in
> output/build/package/) . As it stands with this patch set, I think it
> would be necessary to make a change in the source in
> $(PKG_NAME).git/, commit the change, note the new version, change the
> package version in package/Makefile to the same and make will then
> copy an entire snapshot to a new build-dir/pkg-newversion/.

I understand this need: use Buildroot not only as an integration system
to produce the final system, but also during the development of the
application. For the moment, our recommended practice for this is to
work on the application outside of Buildroot, as Buildroot is not
well-suited for doing this.

Adding such a capability to Buildroot requires a fairly wide
brainstorming and discussion to propose a global design that solves
this question. What do we want to achieve ? What is the exact use
case ? How all development steps are going to work ?

For that reason, I think Maxime's patch is saner: it adds the simple
capability of downloading a package from GIT/SVN, without changing the
existing Buildroot workflow.

I'm really open to changing the Buildroot workflow, but:

 1. I think it requires a much more detailed discussion about *what* we
    need and then *how* we implement it.

 2. I'd prefer to do such major changes once the Buildroot cleanup
    phase (started in January 2009) is more or less completed, so that
    we start with a Buildroot from which we are satisfied in terms of
    quality before starting adding major features such as turning
    Buildroot into a development system and not only an integration
    system. I think it's more important to make Buildroot work properly
    with the feature-set we have today than having dozens of
    half-thought features.

As such a change wouldn't probably occur before 2010.08, I'd prefer to
have a solution similar to Maxime's merged into the tree for the
moment, and having someone seriously starting the discussion on the
Buildroot future as a development system.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
  2010-07-13 14:43 ` [Buildroot] [PATCH/RFC] Download sources from Git (and more) Quotient Remainder
  2010-07-13 18:08   ` Thomas Petazzoni
@ 2010-07-13 20:14   ` Luca Ceresoli
  1 sibling, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-13 20:14 UTC (permalink / raw)
  To: buildroot

Quotient Remainder wrote:
> Ar Luan, 2010-07-12 ag 23:30 +0200, scr?obh Luca Ceresoli:
>   
>> Hi,
>>
>> this patchset is a tentative generalization of the DOWNLOAD macro, as
>> recently discussed in mailing-list, in order to allow BR to obtain
>> package sources not only as tar files from http/ftp, but also using
>> other protocols.
>>
>> I borrowed some pieces of code from Quotient Remainder's patch, but this
>> approach is substiatially different.
>>
>> The feature list is short: I deliberately wanted to be minimalistic
>> but set up a clean infrastructure that can be extended later.
>>
>> Even though these patches are quite polished, please consider them as
>> a proposal for discussion. If there is general consensus about the way
>> I propose, I'll be glad to add a bit of user documentation as well.
>>
>> In the first two patches I prepare the ground by making the download
>> infrastructure more general. The DOWNLOAD function is replaced by a
>> per-package $(PKG)_DOWNLOAD, whose value is computed automatically
>> from the site URL but can be overridden. The good old wget system is
>> modified to fit in the new framework.
>>
>> In the third and fourth commit I add DOWNLOAD_GIT, which is relatively
>> straightforward given the whole infrastructure is already in place.
>> The place where the repository should be cloned might not be appreciated,
>> but I definitely think it should go in output/, as it is part of
>> buildroot's -well- output, not of the package "recipe".
>>
>> The last patch is surely *not* meant to be committed. It's just a
>> minimalistic example of a package downloaded via Git, and would be
>> replaced by user docs as stated above.
>>
>> Luca
>>     
>
> I personally quite like the approach here and think it's more flexible
> than the patch set from Maxime, but have two questions.
>
>  - Why not make the usual tarball in $(DL_DIR) with "git archive
> --format=tar ... | gzip > $(DL_DIR)/..." instead of the self-described
> "hack" of skipping the extraction step?  I suppose it's slightly faster
> since you avoid the compression and decompression time but that mightn't
> be too significant.  I just wonder if the skipping of this stage may
> have some side effects especially if packages have custom extraction
> steps.
>   
That would be very simple, and probably cleaner as you noted.
I think it's worth doing after all, since it would save download time for
example after `make clean`.
I'll code it as time permits.

>  - Do you see any way of making it possible to use the clone as the
> actual working copy used by buildroot?  That is, if I clone a repository
> (as opposed to archive) and then want to make changes, I can edit the
> source and build/test the change in-place (in output/build/package/) .
> As it stands with this patch set, I think it would be necessary to make
> a change in the source in $(PKG_NAME).git/, commit the change, note the
> new version, change the package version in package/Makefile to the same
> and make will then copy an entire snapshot to a new
> build-dir/pkg-newversion/.
>   
This would certainly be useful, but hard to couple with the current
buildroot structure, as Thomas pointed out in this thread. A discussion
would be needed before such a thing.

Luca

>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
  2010-07-13 18:08   ` Thomas Petazzoni
@ 2010-07-13 20:49     ` Luca Ceresoli
  2010-07-14 12:28     ` Quotient Remainder
  1 sibling, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2010-07-13 20:49 UTC (permalink / raw)
  To: buildroot

Thomas Petazzoni wrote:
> Hello,
>
> On Tue, 13 Jul 2010 15:43:39 +0100
> Quotient Remainder <quotientvremainder@gmail.com> wrote:
>
>   
>>  - Do you see any way of making it possible to use the clone as the
>> actual working copy used by buildroot?  That is, if I clone a
>> repository (as opposed to archive) and then want to make changes, I
>> can edit the source and build/test the change in-place (in
>> output/build/package/) . As it stands with this patch set, I think it
>> would be necessary to make a change in the source in
>> $(PKG_NAME).git/, commit the change, note the new version, change the
>> package version in package/Makefile to the same and make will then
>> copy an entire snapshot to a new build-dir/pkg-newversion/.
>>     
>
> I understand this need: use Buildroot not only as an integration system
> to produce the final system, but also during the development of the
> application. For the moment, our recommended practice for this is to
> work on the application outside of Buildroot, as Buildroot is not
> well-suited for doing this.
>
> Adding such a capability to Buildroot requires a fairly wide
> brainstorming and discussion to propose a global design that solves
> this question. What do we want to achieve ? What is the exact use
> case ? How all development steps are going to work ?
>   
I understand your point, and I think the threads seen so far are a good
starting point for this discussion.

> For that reason, I think Maxime's patch is saner: it adds the simple
> capability of downloading a package from GIT/SVN, without changing the
> existing Buildroot workflow.
>   

After reviewing once again the two patches, I've come to the conclusion
that they are quite similar apart from a matter of code style.
Practically I don't think they have big pros/cons over each other.

Creating a tarball would be trivial to add to my patches.

Enabling `git pull` in Maxime's code would probably be easy if the
clone were put in a suitable directory.

Supporting more complex workflows (such as working copies within
the buildroot tree, or integrating git submodules) would require a
deeper analysis and substantial work in both cases.

The choice of which download helper  to use is more readable in
Maxime's code (case-based) but I suspect is more efficient in my
macro-based system which is also more uniform with the rest of
Makefile.package.in.

That said, I think both approaches are sane enough (after the few
discussed improvements) to be applied. I'd like to hear the
maintainer's opinion about this choice. The only one that I wouldn't
agree with is to reject both.

Luca

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH/RFC] Download sources from Git (and more)
  2010-07-13 18:08   ` Thomas Petazzoni
  2010-07-13 20:49     ` Luca Ceresoli
@ 2010-07-14 12:28     ` Quotient Remainder
  1 sibling, 0 replies; 12+ messages in thread
From: Quotient Remainder @ 2010-07-14 12:28 UTC (permalink / raw)
  To: buildroot

On Tue, 2010-07-13 at 20:08 +0200, Thomas Petazzoni wrote:
> I understand this need: use Buildroot not only as an integration system
> to produce the final system, but also during the development of the
> application. For the moment, our recommended practice for this is to
> work on the application outside of Buildroot, as Buildroot is not
> well-suited for doing this.
> 
> Adding such a capability to Buildroot requires a fairly wide
> brainstorming and discussion to propose a global design that solves
> this question. What do we want to achieve ? What is the exact use
> case ? How all development steps are going to work ?
> 
> For that reason, I think Maxime's patch is saner: it adds the simple
> capability of downloading a package from GIT/SVN, without changing the
> existing Buildroot workflow.

A combination of the best of the two may be the way to go.

> I'm really open to changing the Buildroot workflow, but:
> 
>  1. I think it requires a much more detailed discussion about *what* we
>     need and then *how* we implement it.
> 
>  2. I'd prefer to do such major changes once the Buildroot cleanup
>     phase (started in January 2009) is more or less completed, so that
>     we start with a Buildroot from which we are satisfied in terms of
>     quality before starting adding major features such as turning
>     Buildroot into a development system and not only an integration
>     system. I think it's more important to make Buildroot work properly
>     with the feature-set we have today than having dozens of
>     half-thought features.
> 
> As such a change wouldn't probably occur before 2010.08, I'd prefer to
> have a solution similar to Maxime's merged into the tree for the
> moment, and having someone seriously starting the discussion on the
> Buildroot future as a development system.
> 

Understood; that's perfectly reasonable.  The amount of work going into
this project these days in phenomenal.  It is already a great tool but
the cleanup should make it all the more accessible.

I don't mind doing some throwaway work in the meantime in order to spark
some discussion on the points you raised above.

> Best regards,
> 
> Thomas

BTW, I hope I'm not stepping on toes by commenting here on this topic.
I'm eager to get something working but I realise there are many here
that have much greater oversight on what's needed.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-07-14 12:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12 21:30 [Buildroot] [PATCH/RFC] Download sources from Git (and more) Luca Ceresoli
2010-07-12 21:30 ` [Buildroot] [PATCH 1/5] packages: pass the package name to the DOWNLOAD macro Luca Ceresoli
2010-07-12 21:30 ` [Buildroot] [PATCH 2/5] packages: allow different download protocols, with auto detection Luca Ceresoli
2010-07-12 21:42   ` Michael S. Zick
2010-07-12 21:30 ` [Buildroot] [PATCH 3/5] Unleash all of git's power: not only clones Luca Ceresoli
2010-07-12 21:30 ` [Buildroot] [PATCH 4/5] packages: add DOWNLOAD_GIT Luca Ceresoli
2010-07-12 21:30 ` [Buildroot] [PATCH 5/5] FOR TESTING ONLY: Add a GIT-downloaded test package Luca Ceresoli
2010-07-13 14:43 ` [Buildroot] [PATCH/RFC] Download sources from Git (and more) Quotient Remainder
2010-07-13 18:08   ` Thomas Petazzoni
2010-07-13 20:49     ` Luca Ceresoli
2010-07-14 12:28     ` Quotient Remainder
2010-07-13 20:14   ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox