All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE
@ 2018-05-23  9:01 Arnout Vandecappelle
  2018-05-27 13:14 ` Peter Korsgaard
  2018-06-11 21:12 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2018-05-23  9:01 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
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(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 8a3b5f90a9..9bd2358ef6 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -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
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE
  2018-05-23  9:01 [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE Arnout Vandecappelle
@ 2018-05-27 13:14 ` Peter Korsgaard
  2018-06-11 21:12 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-05-27 13:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> 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_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

 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > ---
 > v3: error about _SITE, not about _SITE_METHOD (Thomas)
 > v2: explain in commit message why we check for _OVERRIDE_SRCDIR

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE
  2018-05-23  9:01 [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE Arnout Vandecappelle
  2018-05-27 13:14 ` Peter Korsgaard
@ 2018-06-11 21:12 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-06-11 21:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> 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_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

 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > ---
 > 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.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-11 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23  9:01 [Buildroot] [PATCH v3] pkg-generic: error out with 'local' site method and no _SITE Arnout Vandecappelle
2018-05-27 13:14 ` Peter Korsgaard
2018-06-11 21:12 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.