]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemd: Avoid a Python deprecation warning
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Thu, 13 Jan 2022 03:18:50 +0000 (04:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Jan 2022 09:25:27 +0000 (09:25 +0000)
This avoids the following warning:

  WARNING: .../meta/recipes-core/systemd/systemd_250.1.bb: Var
  <do_install>:1: DeprecationWarning: invalid escape sequence \$

seen when doing `devtool finish --force-patch-refresh systemd meta`.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd_250.1.bb

index b05905b764d8c68d32d891fc62eada35c470d0ed..4dd668833a7c4f1e0fe26b3f808719d8e7c28260 100644 (file)
@@ -297,8 +297,9 @@ do_install() {
 
        # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
        # for existence else it fails
-       if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
-               ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)}
+       if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ] &&
+          ! ${@bb.utils.contains('PACKAGECONFIG', 'networkd', 'true', 'false', d)}; then
+               echo 'd /run/systemd/netif/links 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
        fi
        if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
                echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf