소스 검색

core/pkg-infra: prepare for alternate default source archives

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.

Use a macro as suggested by Arnout.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Vincent Fazio <vfazio@xes-inc.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Vincent Fazio <vfazio@xes-inc.com>
Yann E. MORIN 6 년 전
부모
커밋
38a9fdd02f
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      package/pkg-generic.mk
  2. 5 0
      package/pkg-utils.mk

+ 1 - 1
package/pkg-generic.mk

@@ -518,7 +518,7 @@ ifndef $(2)_SOURCE
  ifdef $(3)_SOURCE
  ifdef $(3)_SOURCE
   $(2)_SOURCE = $$($(3)_SOURCE)
   $(2)_SOURCE = $$($(3)_SOURCE)
  else ifdef $(2)_VERSION
  else ifdef $(2)_VERSION
-  $(2)_SOURCE			?= $$($(2)_BASENAME_RAW).tar.gz
+  $(2)_SOURCE			?= $$($(2)_BASENAME_RAW)$$(call pkg_source_ext,$(2))
  endif
  endif
 endif
 endif
 
 

+ 5 - 0
package/pkg-utils.mk

@@ -40,6 +40,11 @@ KCONFIG_DISABLE_OPT = $(call KCONFIG_MUNGE_DOT_CONFIG, $(1), $(SHARP_SIGN) $(1)
 pkgdir = $(dir $(lastword $(MAKEFILE_LIST)))
 pkgdir = $(dir $(lastword $(MAKEFILE_LIST)))
 pkgname = $(lastword $(subst /, ,$(pkgdir)))
 pkgname = $(lastword $(subst /, ,$(pkgdir)))
 
 
+# Helper to build the extension for a package archive, based on various
+# conditions.
+# $(1): upper-case package name
+pkg_source_ext = .tar.gz
+
 # Define extractors for different archive suffixes
 # Define extractors for different archive suffixes
 INFLATE.bz2  = $(BZCAT)
 INFLATE.bz2  = $(BZCAT)
 INFLATE.gz   = $(ZCAT)
 INFLATE.gz   = $(ZCAT)