Skip to contentSkip to conversation

PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell)

PATCH Applied Bill Randle 2 participants 2 messages Aug 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell)

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.

---

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(-)
lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py +1 -1
index d8b554f..e738521 100644
@@ -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):
Signature · 1 line
2.5.5
Applied
#1 lore raw
Quoted 6 lines · Bill Randle

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

Quoted 31 lines

---

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(-)
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -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):