[yocto] [PATCH] PublishArtifacts.py: check files before copy

Flanagan, Elizabeth elizabeth.flanagan at intel.com
Tue May 20 10:58:20 PDT 2014


I'm going to pull this, but I'm also going to open a bug as the "right
way" to do this is to pass md5sums in as an artifact.

-b

On Mon, May 19, 2014 at 11:45 PM, Yin Kangkai <kangkai.yin at intel.com> wrote:
> Check files existence before copy, otherwise might fail.  For example,
> if I do not enable "MakeImageMD5s" step, "PublishArtifacts" will fail.
>
> Signed-off-by: Yin Kangkai <kangkai.yin at intel.com>
> ---
>  .../autobuilder/buildsteps/PublishArtifacts.py           | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
> index 2080030..95276a4 100644
> --- a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
> @@ -12,7 +12,7 @@ __email__ = "elizabeth.flanagan at intel.com"
>
>  from buildbot.steps.shell import ShellCommand
>  from twisted.python import log
> -import os, datetime
> +import os, datetime, glob
>  from autobuilder.config import *
>
>  class PublishArtifacts(ShellCommand):
> @@ -152,7 +152,8 @@ class PublishArtifacts(ShellCommand):
>                      command=command+"cp -R --no-dereference --preserve=links " + \
>                                      deploy_image_dir + \
>                                      "/*" + artifact + "* " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
> -                    command=command+"cp -R --no-dereference --preserve=links " + \
> +                    if glob.glob(os.path.join(self.basedir, "tmp/deploy/images/") + "*.md5sum"):
> +                        command=command+"cp -R --no-dereference --preserve=links " + \
>                                      os.path.join(self.basedir, "tmp/deploy/images/") + \
>                                      "/*.md5sum " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
>                  elif "mpc8315e" in artifact:
> @@ -161,7 +162,8 @@ class PublishArtifacts(ShellCommand):
>                      command=command+"cp -R --no-dereference --preserve=links " + \
>                                      deploy_image_dir + \
>                                      "/*mpc8315* " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
> -                    command=command+"cp -R --no-dereference --preserve=links " + \
> +                    if glob.glob(os.path.join(self.basedir, "tmp/deploy/images/") + "*.md5sum"):
> +                        command=command+"cp -R --no-dereference --preserve=links " + \
>                                      os.path.join(self.basedir, "tmp/deploy/images/") + \
>                                      "/*.md5sum " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
>                  elif artifact == "tiny":
> @@ -174,7 +176,9 @@ class PublishArtifacts(ShellCommand):
>                          command=command+"cp -R --no-dereference --preserve=links " + \
>                                          os.path.join(self.basedir, "tmp/deploy/images/*") + \
>                                          DEST + "/" + QEMU_PUBLISH_DIR + "/qemu-tiny;"
> -                    command=command+"cp -R --no-dereference --preserve=links " + \
> +
> +                    if glob.glob(os.path.join(self.basedir, "tmp/deploy/images/") + "*.md5sum"):
> +                        command=command+"cp -R --no-dereference --preserve=links " + \
>                                      os.path.join(self.basedir, "tmp/deploy/images/") + \
>                                      "/*.md5sum " + DEST + "/" + QEMU_PUBLISH_DIR + "/qemu-tiny;"
>
> @@ -205,7 +209,9 @@ class PublishArtifacts(ShellCommand):
>                          command=command+"cp -R --no-dereference --preserve=links " + \
>                                           deploy_image_dir + \
>                                           "/*"+artifact+"* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
> -                        command=command+"cp -R --no-dereference --preserve=links " + \
> +
> +                        if glob.glob(os.path.join(self.basedir, "tmp/deploy/images/") + "*.md5sum"):
> +                            command=command+"cp -R --no-dereference --preserve=links " + \
>                                          os.path.join(self.basedir, "tmp/deploy/images/") + \
>                                          "/*.md5sum " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
>
> --
> 1.8.2.1
>



-- 
Elizabeth Flanagan
Yocto Project
Build and Release



More information about the yocto mailing list