]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd.bbclass: Check for existence of the symlink too
authorPavel Zhukov <pavel@zhukoff.net>
Fri, 9 Feb 2024 19:27:28 +0000 (20:27 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 10 Feb 2024 14:12:54 +0000 (14:12 +0000)
If the packages' service file is a link to parameterized service file
provided by different package [1] then link is dangling link at
do_package stage and os.path.exists(path) returns False even if the link
exists. Replace os.path.exists with lexists to fix this issue.

[1]
An example:
  Package A provides myservice@.service

  Package B depends and rdepends on A and provides:
  myservice@B.service -> myservice@.service

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/systemd.bbclass

index 9a16babe4345cc1b59c5e5bbb39892e39c20402a..48b364c1d4d906d0ae6cb717e983122ec47d00a9 100644 (file)
@@ -170,7 +170,7 @@ python systemd_populate_packages() {
                     base = service[:at] + '@' + service[ext:]
 
                 for path in searchpaths:
-                    if os.path.exists(oe.path.join(d.getVar("D"), path, service)):
+                    if os.path.lexists(oe.path.join(d.getVar("D"), path, service)):
                         path_found = path
                         break
                     elif base is not None: