From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnout Vandecappelle Date: Tue, 5 Jan 2021 22:54:54 +0100 Subject: [Buildroot] [PATCH 01/10 v3] core/pkg-infra: prepare for alternate default source archives In-Reply-To: <7d52ccdb9dd1b0e56d1a3720e649f52693ee1c68.1609239666.git.yann.morin.1998@free.fr> References: <7d52ccdb9dd1b0e56d1a3720e649f52693ee1c68.1609239666.git.yann.morin.1998@free.fr> Message-ID: <70d03429-1f06-a327-cb4a-e01d6ad2d9d0@mind.be> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On 29/12/2020 12:01, Yann E. MORIN wrote: > The .tar.gz default extension is historical, and we initially used > to only fetch tarballs from remote sites. > > When we introduced downloads from VCS repositories, we kept that > extension, and kept compressing with gz, by lack of good reason to > switch to some other compression scheme. > > However, nowadays, we will want to change the way we construct the > tarballs we generate from VCS. This will de facto change the hashes > of those tarballs. > > So we will want that the archives we generate do not clash with the > existing ones, so we need another filename. Thus, we need a way to > be able to use a different extension when we generate archives from > VCS. > > Note that we do not need to play the host-defaults-to-target-value > dance we do for the _SOURCE variable, because this is a purely internal > variable, not exposed to packages, and as such, is not documented. > > Signed-off-by: "Yann E. MORIN" > Cc: Thomas Petazzoni > Cc: Vincent Fazio > --- > package/pkg-generic.mk | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk > index 621fb91424..6a9389f1b5 100644 > --- a/package/pkg-generic.mk > +++ b/package/pkg-generic.mk > @@ -514,11 +514,12 @@ ifneq ($$($(2)_OVERRIDE_SRCDIR),) > $(2)_VERSION = custom > endif > > +$(2)_SOURCE_EXT = .tar.gz I generally don't like adding a per-package variable unless really needed, because we already have way to many. Roughly 285K, and this adds another 2.5K. So I'd prefer to either: - put it directly in the _SOURCE definition; or - define it as a macro outside, i.e. use it as '$$(call source-ext,$(2))' This is really a nitpick though, so Acked-by: Arnout Vandecappelle (Essensium/Mind) Regards, Arnout > ifndef $(2)_SOURCE > ifdef $(3)_SOURCE > $(2)_SOURCE = $$($(3)_SOURCE) > else ifdef $(2)_VERSION > - $(2)_SOURCE ?= $$($(2)_BASENAME_RAW).tar.gz > + $(2)_SOURCE ?= $$($(2)_BASENAME_RAW)$$($(2)_SOURCE_EXT) > endif > endif > >