summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs-postcommands.bbclass
diff options
context:
space:
mode:
authorDavide Gardenal <davidegarde2000@gmail.com>2022-05-04 10:39:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-05 21:17:12 +0100
commitbed63756c56f296ff3d5a7eef66e978bd19f1008 (patch)
tree3b79baac27f2056242f4739a7a7a2c0cfdda5b62 /meta/classes/rootfs-postcommands.bbclass
parent2f024c0236c4806f0e59e4ce51a42f6b80fdf1b3 (diff)
downloadopenembedded-core-bed63756c56f296ff3d5a7eef66e978bd19f1008.tar.gz
rootfs-postcommands: fix symlinks where link and output path are equal
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 <davide.gardenal@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs-postcommands.bbclass')
-rw-r--r--meta/classes/rootfs-postcommands.bbclass14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 9b6824043c..d302c23cf4 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"