]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
os-release: Fix VERSION_CODENAME in case it is empty
authorDaniel Semkowicz <dse@thaumatec.com>
Thu, 20 Jun 2024 13:03:31 +0000 (15:03 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Jun 2024 10:49:54 +0000 (11:49 +0100)
If DISTRO_CODENAME was not set, VERSION_CODENAME field was populated
with unparsed string. This resulted in the following line in os-release
file:

  VERSION_CODENAME="${DISTRO_CODENAME}"

According to systemd documentation, this field is optional.
Fix the problem by setting VERSION_CODENAME conditionally, only if
DISTRO_CODENAME was set.

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-core/os-release/os-release.bb

index 8906906bc3eb30b992ceceee4ee7e5626dffd044..93af08c182d2c00ec2ed441039667ab678535ded 100644 (file)
@@ -24,7 +24,7 @@ ID = "${DISTRO}"
 NAME = "${DISTRO_NAME}"
 VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
 VERSION_ID = "${DISTRO_VERSION}"
-VERSION_CODENAME = "${DISTRO_CODENAME}"
+VERSION_CODENAME = "${@d.getVar('DISTRO_CODENAME') or ''}"
 PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
 
 # The vendor field is hardcoded to "openembedded" deliberately. We'd