Skip to contentSkip to conversation

package/pkg-golang: fix illegal variable reference

PATCH New Mirza Krak 2 participants 3 messages Aug 15, 2018

lore
Share & tools
lore

Mirza Krak

author
#0 lore raw

PATCH 1/1 package/pkg-golang: fix illegal variable reference

References to variables inside $(eval) blocks must be with a double dollar sign, otherwise we end up with unintuitive and undesired behavior according to the description in pkg-generic.mk

---
 package/pkg-golang.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/pkg-golang.mk +3 -3
index bf178622b5..6eacd14180 100644
@@ -77,9 +77,9 @@ $(2)_INSTALL_BINS ?= $(1)
 # of GOPATH. It usually resolves around domain/vendor/software. By default, we
 # derive domain/vendor/software from the upstream URL of the project, but we
 # allow $(2)_SRC_SUBDIR to be overridden if needed.
-$(2)_SRC_DOMAIN = $$(call domain,$($(2)_SITE))
-$(2)_SRC_VENDOR = $$(word 1,$$(subst /, ,$$(call notdomain,$($(2)_SITE))))
-$(2)_SRC_SOFTWARE = $$(word 2,$$(subst /, ,$$(call notdomain,$($(2)_SITE))))
+$(2)_SRC_DOMAIN = $$(call domain,$$($(2)_SITE))
+$(2)_SRC_VENDOR = $$(word 1,$$(subst /, ,$$(call notdomain,$$($(2)_SITE))))
+$(2)_SRC_SOFTWARE = $$(word 2,$$(subst /, ,$$(call notdomain,$$($(2)_SITE))))
 
 $(2)_SRC_SUBDIR ?= $$($(2)_SRC_DOMAIN)/$$($(2)_SRC_VENDOR)/$$($(2)_SRC_SOFTWARE)
 $(2)_SRC_PATH = $$(@D)/$$($(2)_WORKSPACE)/src/$$($(2)_SRC_SUBDIR)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 package/pkg-golang: fix illegal variable reference

Hello,

Quoted 8 lines · Mirza Krak

References to variables inside $(eval) blocks must be with a double dollar sign, otherwise we end up with unintuitive and undesired behavior according to the description in pkg-generic.mk

---
 package/pkg-golang.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

I hesitated a bit between applying to master or next. It is a bug fix, so it should be master. But it doesn't cause any visible issue for now, so maybe not master. In the end, since the fix is pretty trivial, I applied to master.

However, I rewrote the commit log to provide (I believe) a better explanation of the issue being fixed.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
author
#2 lore raw

PATCH 1/1 package/pkg-golang: fix illegal variable reference

Quoted 12 lines · Thomas Petazzoni

Hello,

Quoted 8 lines · Mirza Krak

References to variables inside $(eval) blocks must be with a double dollar sign, otherwise we end up with unintuitive and undesired behavior according to the description in pkg-generic.mk

---
 package/pkg-golang.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 7 lines

I hesitated a bit between applying to master or next. It is a bug fix, so it should be master. But it doesn't cause any visible issue for now, so maybe not master. In the end, since the fix is pretty trivial, I applied to master.

However, I rewrote the commit log to provide (I believe) a better explanation of the issue being fixed.

Much better :). Thanks!

Signature · 3 lines
Mirza Krak | Embedded Solutions Architect | https://mender.io

 Northern.tech AS | @northerntechHQ