* [Buildroot] [PATCH] pkg-download with git and not VERSION set in package
@ 2013-03-29 14:07 Patrick Boettcher
2013-03-29 14:07 ` [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git Patrick Boettcher
0 siblings, 1 reply; 4+ messages in thread
From: Patrick Boettcher @ 2013-03-29 14:07 UTC (permalink / raw)
To: buildroot
I'm new to buildroot and was playing with a local git-tree. I noticed
that things weren't working when VERSION is not set in the package.
The following patch is trivial but solves the problem with the current
implemenation.
Please copy me on replies as I'm not yet subscribed.
Patrick Boettcher (1):
pkg-download: take some more care of <PKG_>VERSION when METHOD is git
package/pkg-download.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git
2013-03-29 14:07 [Buildroot] [PATCH] pkg-download with git and not VERSION set in package Patrick Boettcher
@ 2013-03-29 14:07 ` Patrick Boettcher
2013-04-04 11:41 ` Arnout Vandecappelle
0 siblings, 1 reply; 4+ messages in thread
From: Patrick Boettcher @ 2013-03-29 14:07 UTC (permalink / raw)
To: buildroot
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 <Patrick.Boettcher@parrot.com>
---
package/pkg-download.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 1705fcd..d21605a 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -88,7 +88,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) && \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git
2013-04-02 19:40 [Buildroot] [PATCH v2] pkg-download: take some more care of <PKG_>VERSION with git Patrick Boettcher
@ 2013-04-02 19:40 ` Patrick Boettcher
0 siblings, 0 replies; 4+ messages in thread
From: Patrick Boettcher @ 2013-04-02 19:40 UTC (permalink / raw)
To: buildroot
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 <Patrick.Boettcher@parrot.com>
---
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) && \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git
2013-03-29 14:07 ` [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git Patrick Boettcher
@ 2013-04-04 11:41 ` Arnout Vandecappelle
0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2013-04-04 11:41 UTC (permalink / raw)
To: buildroot
On 29/03/13 15:07, Patrick Boettcher wrote:
> 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.
This doesn't work if the version is an unnamed sha1. In that case, a
full clone will be done so HEAD does not point to the requested version.
A better solution is probably to have <PKG>_VERSION default to HEAD if
the site-method is one of the revision control systems.
Regards,
Arnout
>
> Signed-off-by: Patrick Boettcher <Patrick.Boettcher@parrot.com>
> ---
> package/pkg-download.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/pkg-download.mk b/package/pkg-download.mk
> index 1705fcd..d21605a 100644
> --- a/package/pkg-download.mk
> +++ b/package/pkg-download.mk
> @@ -88,7 +88,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) && \
>
--
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-04 11:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 14:07 [Buildroot] [PATCH] pkg-download with git and not VERSION set in package Patrick Boettcher
2013-03-29 14:07 ` [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git Patrick Boettcher
2013-04-04 11:41 ` Arnout Vandecappelle
-- strict thread matches above, loose matches on Subject: below --
2013-04-02 19:40 [Buildroot] [PATCH v2] pkg-download: take some more care of <PKG_>VERSION with git Patrick Boettcher
2013-04-02 19:40 ` [Buildroot] [PATCH] pkg-download: take some more care of <PKG_>VERSION when METHOD is git Patrick Boettcher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox