public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] Fix wrong inline python in isar-image.bbclass
@ 2019-01-10 15:03 Andreas J. Reichel
  2019-01-10 15:31 ` Claudius Heine
  2019-01-18  7:53 ` Maxim Yu. Osipov
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas J. Reichel @ 2019-01-10 15:03 UTC (permalink / raw)
  To: isar-users; +Cc: Andreas Reichel

From: Andreas Reichel <andreas.reichel.ext@siemens.com>

The inline python string used a mixture of python
and shell, which failed while parsing recipes with:

The URL: '${@' is invalid and cannot be interpreted

Problem is that in

SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"

${DISTRO_CONFIG_SCRIPT} is not interpreted correctly.
Use d.getVar instead.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
---
 meta/classes/isar-image.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
index 754e896..e221ba6 100644
--- a/meta/classes/isar-image.bbclass
+++ b/meta/classes/isar-image.bbclass
@@ -6,8 +6,14 @@
 inherit image
 inherit isar-bootstrap-helper
 
+def cfg_script(d):
+    cf = d.getVar('DISTRO_CONFIG_SCRIPT', True) or ''
+    if cf:
+        return 'file://' + cf
+    return ''
+
 FILESPATH =. "${LAYERDIR_isar}/conf/distro:"
-SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"
+SRC_URI += "${@ cfg_script(d) }"
 
 DEPENDS += "${IMAGE_INSTALL} ${IMAGE_TRANSIENT_PACKAGES}"
 
-- 
2.20.1


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

* Re: [PATCH v2] Fix wrong inline python in isar-image.bbclass
  2019-01-10 15:03 [PATCH v2] Fix wrong inline python in isar-image.bbclass Andreas J. Reichel
@ 2019-01-10 15:31 ` Claudius Heine
  2019-01-18  7:53 ` Maxim Yu. Osipov
  1 sibling, 0 replies; 3+ messages in thread
From: Claudius Heine @ 2019-01-10 15:31 UTC (permalink / raw)
  To: [ext] Andreas J. Reichel, isar-users

Hi,

On 10/01/2019 16.03, [ext] Andreas J. Reichel wrote:
> From: Andreas Reichel <andreas.reichel.ext@siemens.com>
> 
> The inline python string used a mixture of python
> and shell, which failed while parsing recipes with:
> 
> The URL: '${@' is invalid and cannot be interpreted
> 
> Problem is that in
> 
> SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"
> 
> ${DISTRO_CONFIG_SCRIPT} is not interpreted correctly.
> Use d.getVar instead.

For people wanting to reproduce this issue, AFAIK Andreas tried to use a 
custom distro config script. Maybe that only happens there. Would be 
nice to have a test case for that.

Cheers,
Claudius

> 
> Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
> ---
>   meta/classes/isar-image.bbclass | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
> index 754e896..e221ba6 100644
> --- a/meta/classes/isar-image.bbclass
> +++ b/meta/classes/isar-image.bbclass
> @@ -6,8 +6,14 @@
>   inherit image
>   inherit isar-bootstrap-helper
>   
> +def cfg_script(d):
> +    cf = d.getVar('DISTRO_CONFIG_SCRIPT', True) or ''
> +    if cf:
> +        return 'file://' + cf
> +    return ''
> +
>   FILESPATH =. "${LAYERDIR_isar}/conf/distro:"
> -SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"
> +SRC_URI += "${@ cfg_script(d) }"
>   
>   DEPENDS += "${IMAGE_INSTALL} ${IMAGE_TRANSIENT_PACKAGES}"
>   
> 

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de

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

* Re: [PATCH v2] Fix wrong inline python in isar-image.bbclass
  2019-01-10 15:03 [PATCH v2] Fix wrong inline python in isar-image.bbclass Andreas J. Reichel
  2019-01-10 15:31 ` Claudius Heine
@ 2019-01-18  7:53 ` Maxim Yu. Osipov
  1 sibling, 0 replies; 3+ messages in thread
From: Maxim Yu. Osipov @ 2019-01-18  7:53 UTC (permalink / raw)
  To: Andreas J. Reichel, isar-users

On 1/10/19 4:03 PM, Andreas J. Reichel wrote:
> From: Andreas Reichel <andreas.reichel.ext@siemens.com>
> 
> The inline python string used a mixture of python
> and shell, which failed while parsing recipes with:
> 
> The URL: '${@' is invalid and cannot be interpreted
> 
> Problem is that in
> 
> SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"
> 
> ${DISTRO_CONFIG_SCRIPT} is not interpreted correctly.
> Use d.getVar instead.

Rebased and applied to the 'next',

Thanks,
Maxim.

> Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
> ---
>   meta/classes/isar-image.bbclass | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
> index 754e896..e221ba6 100644
> --- a/meta/classes/isar-image.bbclass
> +++ b/meta/classes/isar-image.bbclass
> @@ -6,8 +6,14 @@
>   inherit image
>   inherit isar-bootstrap-helper
>   
> +def cfg_script(d):
> +    cf = d.getVar('DISTRO_CONFIG_SCRIPT', True) or ''
> +    if cf:
> +        return 'file://' + cf
> +    return ''
> +
>   FILESPATH =. "${LAYERDIR_isar}/conf/distro:"
> -SRC_URI += "${@ 'file://${DISTRO_CONFIG_SCRIPT}' if '${DISTRO_CONFIG_SCRIPT}' else '' }"
> +SRC_URI += "${@ cfg_script(d) }"
>   
>   DEPENDS += "${IMAGE_INSTALL} ${IMAGE_TRANSIENT_PACKAGES}"
>   
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

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

end of thread, other threads:[~2019-01-18  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 15:03 [PATCH v2] Fix wrong inline python in isar-image.bbclass Andreas J. Reichel
2019-01-10 15:31 ` Claudius Heine
2019-01-18  7:53 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox