diff options
Diffstat (limited to 'yocto-poky/meta/recipes-core/os-release/os-release.bb')
-rw-r--r-- | yocto-poky/meta/recipes-core/os-release/os-release.bb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/yocto-poky/meta/recipes-core/os-release/os-release.bb b/yocto-poky/meta/recipes-core/os-release/os-release.bb index c690b82b2..f519addd8 100644 --- a/yocto-poky/meta/recipes-core/os-release/os-release.bb +++ b/yocto-poky/meta/recipes-core/os-release/os-release.bb @@ -23,28 +23,26 @@ PRETTY_NAME = "${DISTRO_NAME} ${VERSION}" BUILD_ID ?= "${DATETIME}" BUILD_ID[vardepsexclude] = "DATETIME" +def sanitise_version(ver): + # VERSION_ID should be (from os-release(5)): + # lower-case string (mostly numeric, no spaces or other characters + # outside of 0-9, a-z, ".", "_" and "-") + ret = ver.replace('+', '-').replace(' ','_') + return ret.lower() + python do_compile () { import shutil with open(d.expand('${B}/os-release'), 'w') as f: for field in d.getVar('OS_RELEASE_FIELDS', True).split(): value = d.getVar(field, True) + if value and field == 'VERSION_ID': + value = sanitise_version(value) if value: - f.write('{0}={1}\n'.format(field, value)) - if d.getVar('RPM_SIGN_PACKAGES', True) == '1': - rpm_gpg_pubkey = d.getVar('RPM_GPG_PUBKEY', True) - bb.utils.mkdirhier('${B}/rpm-gpg') - distro_version = d.getVar('DISTRO_VERSION', True) or "oe.0" - shutil.copy2(rpm_gpg_pubkey, d.expand('${B}/rpm-gpg/RPM-GPG-KEY-%s' % distro_version)) + f.write('{0}="{1}"\n'.format(field, value)) } do_compile[vardeps] += "${OS_RELEASE_FIELDS}" -do_compile[depends] += "signing-keys:do_export_public_keys" do_install () { install -d ${D}${sysconfdir} install -m 0644 os-release ${D}${sysconfdir}/ - - if [ -d "rpm-gpg" ]; then - install -d "${D}${sysconfdir}/pki" - cp -r "rpm-gpg" "${D}${sysconfdir}/pki/" - fi } |