]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
base.bbclass: Fix dangling NATIVELSBSTRING rbt/lsb
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 14 Feb 2023 07:40:37 +0000 (15:40 +0800)
committerRobert Yang <liezhi.yang@windriver.com>
Tue, 14 Feb 2023 08:25:02 +0000 (00:25 -0800)
Fixed:
$ rm -fr tmp; bitbake quilt-native -n
Build Configuration:
[snip]
NATIVELSBSTRING      = "ubuntu-18.04"
[snip]

And when run bitbake again:
$ bitbake quilt-native -n
Build Configuration:
NATIVELSBSTRING      = "universal"

It has been changed from ubuntu-18.04 to universal on the same host and build
directory, this is because it is overridded by NATIVELSBSTRING. This patch
makes it print the correct value.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
meta/classes-global/base.bbclass

index 64e805c9476c87840370e41a1422b4d56b4b8acf..cf42d9d4d22118cd9b21b8fcd047252eff02e6de 100644 (file)
@@ -226,7 +226,12 @@ BUILDCFG_FUNCS[type] = "list"
 def buildcfg_vars(d):
     statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
     for var in statusvars:
-        value = d.getVar(var)
+        # NATIVELSBSTRING var may have been overridden with "universal", so
+        # get actual host distribution id and version
+        if var == 'NATIVELSBSTRING':
+            value = lsb_distro_identifier(d)
+        else:
+            value = d.getVar(var)
         if value is not None:
             yield '%-20s = "%s"' % (var, value)