Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] busybox/gtk/perl/base-passwd: Ensure data is correctly expanded
Date: Tue, 02 Feb 2016 13:50:47 +0000	[thread overview]
Message-ID: <1454421047.27087.57.camel@linuxfoundation.org> (raw)

Where variables are used in python, we need to ensure they are expanded.
This happens to work at the moment but likely will not happen in future
and isn't good code practise.

Its mostly an issue around key values, since bitbake has already
performed key expansion when these functions are executed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
index a770168..10457b2 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -89,7 +89,7 @@ if [ ! -e $D${sysconfdir}/group ]; then
 """ + group + """EOF
 fi
 """
-    d.setVar('pkg_preinst_${PN}', preinst)
+    d.setVar(d.expand('pkg_preinst_${PN}'), preinst)
 }
 
 addtask do_package after do_populate_sysroot
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index e5710f0..f74d1a4 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -346,6 +346,8 @@ python do_package_prepend () {
     dvar = d.getVar('D', True)
     pn = d.getVar('PN', True)
     def set_alternative_vars(links, target):
+        links = d.expand(links)
+        target = d.expand(target)
         f = open('%s%s' % (dvar, links), 'r')
         for alt_link_name in f:
             alt_link_name = alt_link_name.strip()
diff --git a/meta/recipes-devtools/perl/perl_5.22.1.bb b/meta/recipes-devtools/perl/perl_5.22.1.bb
index 705852c..54594b1 100644
--- a/meta/recipes-devtools/perl/perl_5.22.1.bb
+++ b/meta/recipes-devtools/perl/perl_5.22.1.bb
@@ -349,7 +349,7 @@ python populate_packages_prepend () {
     # modules. Don't attempt to use the result of do_split_packages() as some
     # modules are manually split (eg. perl-module-unicore).
     packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES', True).split())
-    d.setVar("RRECOMMENDS_${PN}-modules", ' '.join(packages))
+    d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
 }
 
 PACKAGES_DYNAMIC += "^perl-module-.*"
diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc
index 36f7b0c..353c521 100644
--- a/meta/recipes-gnome/gtk+/gtk+3.inc
+++ b/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -106,6 +106,6 @@ python populate_packages_prepend () {
     do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
 
     if (d.getVar('DEBIAN_NAMES', 1)):
-        d.setVar('PKG_${PN}', '${MLPREFIX}libgtk-3.0')
+        d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
 }
 
diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb
index 675ef6d..cf55d20 100644
--- a/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb
+++ b/meta/recipes-gnome/gtk+/gtk+_2.24.29.bb
@@ -30,5 +30,5 @@ python populate_packages_prepend () {
     do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
 
     if (d.getVar('DEBIAN_NAMES', True)):
-        d.setVar('PKG_${PN}', '${MLPREFIX}libgtk-2.0')
+        d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0')
 }




                 reply	other threads:[~2016-02-02 13:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454421047.27087.57.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox