pkg-generic: error out with 'local' site method and no _SITE
PATCH v3 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.
We check for _OVERRIDE_SRCDIR rather than checking for _SITE, just after _OVERRIDE_SRCDIR has been set to _SITE. Indeed, a package that sets _OVERRIDE_SRCDIR but not _SITE currently works correctly. There is no reason to make it fail.
See also
https://stackoverflow.com/questions/50364655/including-patches-to-build-root
---
v3: error about _SITE, not about _SITE_METHOD (Thomas)
v2: explain in commit message why we check for _OVERRIDE_SRCDIR
--- 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` is not defined) +endif endif ifndef $(2)_LICENSE
Signature · 1 line
2.17.0
PATCH v3 1/1 pkg-generic: error out with 'local' site method and no _SITE
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:
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.We check for
_OVERRIDE_SRCDIRrather than checking for_SITE, just after_OVERRIDE_SRCDIRhas been set to_SITE. Indeed, a package that sets_OVERRIDE_SRCDIRbut not_SITEcurrently works correctly. There is no reason to make it fail.
Quoted 7 lines
See also
https://stackoverflow.com/questions/50364655/including-patches-to-build-root---
v3: error about_SITE, not about_SITE_METHOD(Thomas)
v2: explain in commit message why we check for_OVERRIDE_SRCDIR
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 1/1 pkg-generic: error out with 'local' site method and no _SITE
In reply to Arnout Vandecappelle (Essensium/Mind)Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:
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.We check for
_OVERRIDE_SRCDIRrather than checking for_SITE, just after_OVERRIDE_SRCDIRhas been set to_SITE. Indeed, a package that sets_OVERRIDE_SRCDIRbut not_SITEcurrently works correctly. There is no reason to make it fail.
Quoted 7 lines
See also
https://stackoverflow.com/questions/50364655/including-patches-to-build-root---
v3: error about_SITE, not about_SITE_METHOD(Thomas)
v2: explain in commit message why we check for_OVERRIDE_SRCDIR
Committed to 2018.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard