]> code.ossystems Code Review - openembedded-core.git/commitdiff
license_image.bbclass: Don't attempt to symlink to the same file
authorMike Looijmans <mike.looijmans@topic.nl>
Fri, 5 Feb 2021 14:53:33 +0000 (15:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 6 Feb 2021 09:02:51 +0000 (09:02 +0000)
Sometimes (that is, in all my builds) the lic_manifest_dir and
lic_manifest_symlink_dir end up pointing to the same file, resulting
in an error like this:
  Exception: FileExistsError: [Errno 17] File exists: '/.../tmp-glibc/deploy/licenses/my-image-tdkz15' -> '/.../tmp-glibc/deploy/licenses/my-image-tdkz15'

First check to see if this is the case before attempting to create
the link.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license_image.bbclass

index 8fd88cfb2d91e77465b93dc7c67177ee15402d1b..36ddd84805be521728b2c7198e35778552f2bfd5 100644 (file)
@@ -210,7 +210,8 @@ def license_deployed_manifest(d):
             os.unlink(lic_manifest_symlink_dir)
 
         # create the image dir symlink
-        os.symlink(lic_manifest_dir, lic_manifest_symlink_dir)
+        if lic_manifest_dir != lic_manifest_symlink_dir:
+            os.symlink(lic_manifest_dir, lic_manifest_symlink_dir)
 
 def get_deployed_dependencies(d):
     """