All of lore.kernel.org
 help / color / mirror / Atom feed
* [yocto-autobuilder][PATCH v2] PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell)
@ 2016-08-22 14:52 Bill Randle
  2016-08-22 15:21 ` Joshua Lock
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Randle @ 2016-08-22 14:52 UTC (permalink / raw)
  To: yocto

An earlier patch (ed3857990) to check for existing msd5sum files worked
fine when tested under bash, but failed with an error message about [[
not found when run under dash. Updated the test to not rely on bashisms.

Signed-off-by: Bill Randle <william.c.randle@intel.com>
---

V2: use POSIX shell expansion for simplified test (thanks Joshua)

 lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
index d8b554f..e738521 100644
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
@@ -260,7 +260,7 @@ class PublishArtifacts(ShellCommand):
         cmd = ""
         if os.environ.get('GEN_IMG_MD5') == "True":
             cmd += "for x in `find " + deploy_dir + " -maxdepth 5 -type f`;"
-            cmd += "do if [[ $x != *.md5sum ]]; then md5sum $x >> " + "$x.md5sum; fi; done;"
+            cmd += "do if [ ${x##*.} != md5sum ]; then md5sum $x >> " + "$x.md5sum; fi; done;"
         return cmd
 
     def getDeployNames(self, artifact, buildername):
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [yocto-autobuilder][PATCH v2] PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell)
  2016-08-22 14:52 [yocto-autobuilder][PATCH v2] PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell) Bill Randle
@ 2016-08-22 15:21 ` Joshua Lock
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Lock @ 2016-08-22 15:21 UTC (permalink / raw)
  To: Bill Randle, yocto

On Mon, 2016-08-22 at 07:52 -0700, Bill Randle wrote:
> An earlier patch (ed3857990) to check for existing msd5sum files
> worked
> fine when tested under bash, but failed with an error message about
> [[
> not found when run under dash. Updated the test to not rely on
> bashisms.

Pushed to master, thanks!

Joshua

> 
> Signed-off-by: Bill Randle <william.c.randle@intel.com>
> ---
> 
> V2: use POSIX shell expansion for simplified test (thanks Joshua)
> 
>  lib/python2.7/site-
> packages/autobuilder/buildsteps/PublishArtifacts.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/python2.7/site-
> packages/autobuilder/buildsteps/PublishArtifacts.py
> b/lib/python2.7/site-
> packages/autobuilder/buildsteps/PublishArtifacts.py
> index d8b554f..e738521 100644
> --- a/lib/python2.7/site-
> packages/autobuilder/buildsteps/PublishArtifacts.py
> +++ b/lib/python2.7/site-
> packages/autobuilder/buildsteps/PublishArtifacts.py
> @@ -260,7 +260,7 @@ class PublishArtifacts(ShellCommand):
>          cmd = ""
>          if os.environ.get('GEN_IMG_MD5') == "True":
>              cmd += "for x in `find " + deploy_dir + " -maxdepth 5
> -type f`;"
> -            cmd += "do if [[ $x != *.md5sum ]]; then md5sum $x >> "
> + "$x.md5sum; fi; done;"
> +            cmd += "do if [ ${x##*.} != md5sum ]; then md5sum $x >>
> " + "$x.md5sum; fi; done;"
>          return cmd
>  
>      def getDeployNames(self, artifact, buildername):


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-22 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 14:52 [yocto-autobuilder][PATCH v2] PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell) Bill Randle
2016-08-22 15:21 ` Joshua Lock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.