Skip to contentSkip to conversation

license_image.bbclass: Don't attempt to symlink to the same file

PATCH Superseded Mike Looijmans 2 participants 4 messages Feb 5, 2021 3 messages not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 license_image.bbclass: Don't attempt to symlink to the same file

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.

---
 meta/classes/license_image.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/license_image.bbclass +2 -1
index 119c8dfc86..6f478ce22c 100644
@@ -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):
     """
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Mike Looijmans

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.

Is this not required in master branch? I can't see this change there.

Thanks,

Anuj

#2 lore raw

Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topicproducts.com

Please consider the environment before printing this e-mail

Quoted 11 lines · Anuj
Quoted 9 lines · Mike Looijmans

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.

Is this not required in master branch? I can't see this change there.

Probably yes, too.

And half the commit message got lost somewhere. I'll try a resend...

Signature · 1 line
Mike Looijmans

A message that is not in the archive (sent off-list or not yet received): 1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.2911e63c-9e5c-4e4f-ace5-3d0373a59996@emailsignatures365.codetwo.com

A message that is not in the archive (sent off-list or not yet received): 1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.0c810297-d118-4896-b755-845b359e15b7@emailsignatures365.codetwo.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topicproducts.com

Please consider the environment before printing this e-mail

Quoted 9 lines · Mike Looijmans via lists.openembedded.org
Quoted 8 lines · Anuj
Quoted 7 lines · Mike Looijmans

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'

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

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

Is this not required in master branch? I can't see this change there.

Probably yes, too.

And half the commit message got lost somewhere. I'll try a resend...

Oh weird... Apparently the company mailserver that did that. The version on the list is okay, the one in my mailbox lacks the first half of the commit text. Same with the v2 mail.

Signature · 1 line
Mike Looijmans