Skip to contentSkip to conversation

rootfs-postcommands: Cope with empty IMAGE_LINK_NAME in write_image_manifest

PATCH New Mike Crowe 1 participant 2 messages Jul 15, 2019

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/2 rootfs-postcommands: Cope with empty IMAGE_LINK_NAME in write_image_manifest

Ensure that we don't create a symlink named ".manifest" if IMAGE_LINK_NAME is empty.

---
 meta/classes/rootfs-postcommands.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/rootfs-postcommands.bbclass +1 -1
index 89f8efd323..a2fe3dea2b 100644
@@ -260,7 +260,7 @@ python write_image_manifest () {
     with open(manifest_name, 'w+') as image_manifest:
         image_manifest.write(format_pkg_list(pkgs, "ver"))
 
-    if os.path.exists(manifest_name):
+    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)
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH 2/2 rootfs-postcommands: Cope with empty IMAGE_LINK_NAME in write_image_test_data

From: Mike Crowe <[email protected]>

Ensure that we don't create an image test data symlink named ".testdata.json" when IMAGE_LINK_NAME is empty.

---
 meta/classes/rootfs-postcommands.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/rootfs-postcommands.bbclass +1 -1
index a2fe3dea2b..6cec23ef1a 100644
@@ -328,7 +328,7 @@ python write_image_test_data() {
     searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
     export2json(d, testdata_name, searchString=searchString, replaceString="")
 
-    if os.path.exists(testdata_name):
+    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)
Signature · 1 line
2.20.1