Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] base-files: Avoid problems if DISTRO_VERSION contains undefined variable
@ 2019-01-18 15:41 Peter Kjellerstedt
  0 siblings, 0 replies; only message in thread
From: Peter Kjellerstedt @ 2019-01-18 15:41 UTC (permalink / raw)
  To: openembedded-core

If DISTRO_VERSION is defined to some undefined variable, e.g.,
DISTRO_VERSION = "${FOO_VERSION}", and /bin/sh is dash, then
do_install() would fail with an error such as:

  run.do_install.2945:193: run.do_install.2945: Syntax error:
  Unterminated quoted string

This was due to unexpanded Python code making it into the shell code,
confusing the shell parser.

Reported-by: srinivasan <srinivasan.rns@gmail.com>
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/recipes-core/base-files/base-files_3.0.14.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 6e30c149ba..f42a4ef7c4 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -150,7 +150,7 @@ do_install_basefilesissue () {
 		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
 		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
 		if [ -n "${DISTRO_VERSION}" ]; then
-			distro_version_nodate=${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}
+			distro_version_nodate="${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}"
 			printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue
 			printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue.net
 		fi
-- 
2.12.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-18 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-18 15:41 [PATCH] base-files: Avoid problems if DISTRO_VERSION contains undefined variable Peter Kjellerstedt

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