[yocto] [yocto-autobuilder][PATCH] PublishArtifacts.py: generate md5sums for buildtools

Bill Randle william.c.randle at intel.com
Fri Aug 12 20:44:59 PDT 2016


Md5sum files were not being generated for the buildtools artifacts. Also,
ignore files with a .md5sum extension when doing the sum.

Signed-off-by: Bill Randle <william.c.randle at intel.com>
---
 .../autobuilder/buildsteps/PublishArtifacts.py     | 27 ++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
index f9ff4f6..1a938fc 100644
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
@@ -112,9 +112,11 @@ class PublishArtifacts(ShellCommand):
                                         os.path.join(self.tmpdir, "deploy/images/*.zip") + \
                                         " " + DEST + "/" + BA_PUBLISH_DIR + ";"
                 elif artifact == "buildtools-tarball":
+                    artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
+                    command=command+self.generateMD5cmd(artifact, deploy_image_dir)
                     command=command+"mkdir -p " + DEST + "/buildtools;"
                     command=command+"cp -R --no-dereference --preserve=links " + \
-                                    os.path.join(self.tmpdir, "deploy/sdk/*buildtools*") + \
+                                    os.path.join(deploy_image_dir, "*buildtools*") + \
                                     " " + DEST + "/buildtools;"
                 elif artifact == "rpm":
                     command=command+"mkdir -p " + os.path.join(DEST, RPM_PUBLISH_DIR) + ";"
@@ -144,22 +146,26 @@ class PublishArtifacts(ShellCommand):
                     else:
                         command=command+"echo 'Skipping copy of sstate, PUBLISH_SSTATE not set.';"
                 elif artifact == "toolchain":
+                    artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
+                    command=command+self.generateMD5cmd(artifact, deploy_image_dir)
                     command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
                     command=command+"cp -R --no-dereference --preserve=links " + \
-                                    os.path.join(self.tmpdir, "deploy/sdk/poky-*i686-core-image*.sh ") + \
+                                    os.path.join(deploy_image_dir, "poky-*i686-core-image*.sh ") + \
                                     os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
                     command=command+"mkdir -p " + os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
                     command=command+"cp -R --no-dereference --preserve=links " + \
-                                    os.path.join(self.tmpdir, "deploy/sdk/poky-*x86_64-core-image*.sh ") + \
+                                    os.path.join(deploy_image_dir, "poky-*x86_64-core-image*.sh ") + \
                                     os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
                 elif artifact == "uninative":
+                    artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
+                    command=command+self.generateMD5cmd(artifact, deploy_image_dir)
                     command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
                     command=command+"cp -R --no-dereference --preserve=links " + \
-                                    os.path.join(self.tmpdir, "deploy/sdk/i686-nativesdk-libc* ") + \
+                                    os.path.join(deploy_image_dir, "i686-nativesdk-libc* ") + \
                                     os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
                     command=command+"mkdir -p " + os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
                     command=command+"cp -R --no-dereference --preserve=links " + \
-                                    os.path.join(self.tmpdir, "deploy/sdk/x86_64-nativesdk-libc* ") + \
+                                    os.path.join(deploy_image_dir, "x86_64-nativesdk-libc* ") + \
                                     os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
                 elif artifact == "oe-toolchain":
                     command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
@@ -209,7 +215,7 @@ class PublishArtifacts(ShellCommand):
                                      os.path.join(self.basedir, "conf/") + \
                                      "/* " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + "/conf;"
                 elif artifact == "md5sums":
-                    command = command + "echo 'MD5sums are generated and deployed from the image artifact';"
+                    command = command + "echo 'MD5sums are generated and deployed from the image or toolchain artifact';"
                 elif artifact == "None":
                     command=command+"echo 'Skipping copy of " + artifact + ".';"
                 else:
@@ -248,8 +254,8 @@ class PublishArtifacts(ShellCommand):
     def generateMD5cmd(self, artifact, deploy_dir):
         cmd = ""
         if os.environ.get('GEN_IMG_MD5') == "True":
-            cmd += "for x in `find " + deploy_dir + " -type f -maxdepth 5`;"
-            cmd += "do md5sum $x >> " + "$x.md5sum; done;"
+            cmd += "for x in `find " + deploy_dir + " -maxdepth 5 -type f`;"
+            cmd += "do if [[ $x != *.md5sum ]]; then md5sum $x >> " + "$x.md5sum; fi; done;"
         return cmd
 
     def getDeployNames(self, artifact, buildername):
@@ -258,8 +264,11 @@ class PublishArtifacts(ShellCommand):
             artifact_name = artifact_name + "-lsb"
         if "-wic" in buildername:
             deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/wic_images/"), artifact)
-        elif artifact_name is "md5sums":
+        elif artifact_name == "md5sums":
             deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
+        elif artifact_name == "uninative" or artifact_name == "buildtools-tarball" \
+          or artifact_name == "toolchain":
+            deploy_dir_image = os.path.join(self.tmpdir, "deploy/sdk/")
         else:
             if self.layerversion_core is not None and int(self.layerversion_core) > 2:
                 deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/images/"), artifact)
-- 
2.5.5




More information about the yocto mailing list