Re: [OE-core] [master][kirkstone][PATCH v2] rootfs-postcommands: fix symlinks where link and output path are equal

2022-05-04 Thread Luca Ceresoli via lists.openembedded.org
Hi Davide,

Il giorno Tue,  3 May 2022 11:56:27 +0200
"Davide Gardenal"  ha scritto:

> When creating the manifest and the testdata.json links, if the link
> name is equal to the output name the link is not created, otherwise
> it is. This prevents a link-to-self in the first case.
> 
> Signed-off-by: Davide Gardenal 
> ---
> Updates:
> - v2: change tabs into spaces
> ---
>  meta/classes/rootfs-postcommands.bbclass | 14 --
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/classes/rootfs-postcommands.bbclass
> b/meta/classes/rootfs-postcommands.bbclass index
> 7b92df69c5..2fa388ba95 100644 ---
> a/meta/classes/rootfs-postcommands.bbclass +++
> b/meta/classes/rootfs-postcommands.bbclass @@ -267,9 +267,10 @@
> python write_image_manifest () { 
>  if os.path.exists(manifest_name) and link_name:
>  manifest_link = deploy_dir + "/" + link_name + ".manifest"
> -if os.path.lexists(manifest_link):
> -os.remove(manifest_link)
> -os.symlink(os.path.basename(manifest_name), manifest_link)
> +if manifest_link != manifest_name

A missing ':' here causes parsing failures:

https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3616/steps/13/logs/stdio

At least some testing should be done on any patch before being sent. It
looks like either this didn't happen or the patch got mangled before it
was sent. Did you use 'git send-email' to send it?

Best regards.
-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165213): 
https://lists.openembedded.org/g/openembedded-core/message/165213
Mute This Topic: https://lists.openembedded.org/mt/90855850/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [master][kirkstone][PATCH v2] rootfs-postcommands: fix symlinks where link and output path are equal

2022-05-03 Thread Davide Gardenal
When creating the manifest and the testdata.json links, if the link
name is equal to the output name the link is not created, otherwise
it is. This prevents a link-to-self in the first case.

Signed-off-by: Davide Gardenal 
---
Updates:
- v2: change tabs into spaces
---
 meta/classes/rootfs-postcommands.bbclass | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass 
b/meta/classes/rootfs-postcommands.bbclass
index 7b92df69c5..2fa388ba95 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -267,9 +267,10 @@ python write_image_manifest () {
 
 if os.path.exists(manifest_name) and link_name:
 manifest_link = deploy_dir + "/" + link_name + ".manifest"
-if os.path.lexists(manifest_link):
-os.remove(manifest_link)
-os.symlink(os.path.basename(manifest_name), manifest_link)
+if manifest_link != manifest_name
+if os.path.lexists(manifest_link):
+os.remove(manifest_link)
+os.symlink(os.path.basename(manifest_name), manifest_link)
 }
 
 # Can be used to create /etc/timestamp during image construction to give a 
reasonably
@@ -339,9 +340,10 @@ python write_image_test_data() {
 
 if os.path.exists(testdata_name) and link_name:
 testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % 
link_name)
-if os.path.lexists(testdata_link):
-os.remove(testdata_link)
-os.symlink(os.path.basename(testdata_name), testdata_link)
+if testdata_link != testdata_name:
+if os.path.lexists(testdata_link):
+os.remove(testdata_link)
+os.symlink(os.path.basename(testdata_name), testdata_link)
 }
 write_image_test_data[vardepsexclude] += "TOPDIR"
 
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165199): 
https://lists.openembedded.org/g/openembedded-core/message/165199
Mute This Topic: https://lists.openembedded.org/mt/90855850/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-