pkg-generic: error out with 'local' site method and no _SITE
PATCH 1/1 pkg-generic: error out with 'local' site method and no _SITE
The 'local' site method is easily confused with the 'file' site method, making people create packages like this:
FOO_SITE_METHOD = local
FOO_SOURCE = foo.tar.gz
$(eval $(generic-package))
Due to the intricacies of the generic package infra, this does not cause an error; instead, the foo.tar.gz tarball that happens to be present in the download directory will be used. This behaviour differs greatly from what is specified in the manual.
Instead, error out immediately if a package specifies the 'local' site method but does not specify a _SITE.
See also
https://stackoverflow.com/questions/50364655/including-patches-to-build-root
--- package/pkg-generic.mk | 3 +++ 1 file changed, 3 insertions(+)
package/pkg-generic.mk +3 -0
@@ -520,6 +520,9 @@ ifeq ($$($(2)_SITE_METHOD),local) ifeq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_OVERRIDE_SRCDIR = $$($(2)_SITE) endif +ifeq ($$($(2)_OVERRIDE_SRCDIR),) +$$(error $(1) has local site method, but `$(2)_SITE_METHOD` is not defined) +endif endif ifndef $(2)_LICENSE
Signature · 1 line
2.17.0
PATCH 1/1 pkg-generic: error out with 'local' site method and no _SITE
Hello,
package/pkg-generic.mk ifeq ($$($(2)_SITE_METHOD),local) · line 525
Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)
package/pkg-generic.mk +3
-0+ifeq ($$($(2)_OVERRIDE_SRCDIR),) +$$(error $(1) has local site method, but `$(2)_SITE_METHOD` is not defined) +endif
Are you sure it shouldn't be "$(2)_SITE" is not defined ?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 pkg-generic: error out with 'local' site method and no _SITE
Quoted 10 lines · Thomas Petazzoni
Hello,
package/pkg-generic.mk ifeq ($$($(2)_SITE_METHOD),local) · line 525
Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)
package/pkg-generic.mk +3
-0+ifeq ($$($(2)_OVERRIDE_SRCDIR),) +$$(error $(1) has local site method, but `$(2)_SITE_METHOD` is not defined) +endifAre you sure it shouldn't be "$(2)_SITE" is not defined ?
That was actually intentional. The idea is to allow 'local' packages to set
either _SITE or _OVERRIDE_SRCDIR. The check comes after the assignment to _OVERRIDE_SRCDIR. The reason for this is: currently, 'local' packages work correctly if you set _OVERRIDE_SRCDIR instead of _SITE, and I don't see a reason to make them fail.
I probably should have explained this in the commit log. It was a bit short :-)
Regards,
Arnout
Signature · 6 lines
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: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 1/1 pkg-generic: error out with 'local' site method and no _SITE
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle <[email protected]> writes:
Quoted 10 lines · Thomas Petazzoni
Hello,
package/pkg-generic.mk ifeq ($$($(2)_SITE_METHOD),local) · line 525
Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)
package/pkg-generic.mk +3
-0+ifeq ($$($(2)_OVERRIDE_SRCDIR),) +$$(error $(1) has local site method, but `$(2)_SITE_METHOD` is not defined) +endifAre you sure it shouldn't be "$(2)_SITE" is not defined ?
Quoted 7 lines
That was actually intentional. The idea is to allow 'local' packages to set
either_SITEor_OVERRIDE_SRCDIR. The check comes after the assignment to_OVERRIDE_SRCDIR. The reason for this is: currently, 'local' packages work correctly if you set_OVERRIDE_SRCDIRinstead of_SITE, and I don't see a reason to make them fail.I probably should have explained this in the commit log. It was a bit short :-)
Indeed! Will you send an update?
Signature · 1 line
Bye, Peter Korsgaard