Skip to content

Commit 3cc66b4

Browse files
yann-morin-1998eocanha
authored andcommitted
core: add a variable that points to the package's hash file
When a package has a version selection (e.g. Qt5), the licensing terms may be different across versions, but lie in similarly named files (e.g. 'LICENSE'). However, when we check a file, all the hashes for it must match. So, we can't have the hashes for two different content of the same file. We overcame that limitation in the legal-license-file macro, which checks whether a package has a .hash file in a versioned subdir. For consistency, we would like to also store the source hashes in that per-version subdir. Rather than reconstruct the path to the hash file everywhere we need it, add a variable that points to it. Existing users will be converted over in followup patches. Note: the check for a missing hash file is done in the check-hash helper script, so this variable must always yield a filename, even of a missing file, thus we do not use $(wildcard...) to resolve the hash file path; we use $(wildcard...) only to check if the versioned .hash file exists. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
1 parent a00613c commit 3cc66b4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

package/pkg-generic.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,12 @@ else
417417
endif
418418
$(2)_VERSION := $$(call sanitize,$$($(2)_DL_VERSION))
419419

420+
$(2)_HASH_FILE = \
421+
$$(strip \
422+
$$(if $$(wildcard $$($(2)_PKGDIR)/$$($(2)_VERSION)/$$($(2)_RAWNAME).hash),\
423+
$$($(2)_PKGDIR)/$$($(2)_VERSION)/$$($(2)_RAWNAME).hash,\
424+
$$($(2)_PKGDIR)/$$($(2)_RAWNAME).hash))
425+
420426
ifdef $(3)_OVERRIDE_SRCDIR
421427
$(2)_OVERRIDE_SRCDIR ?= $$($(3)_OVERRIDE_SRCDIR)
422428
endif

0 commit comments

Comments
 (0)