PublishArtifacts.py: fix filecheck to work under dash (or other POSIX shell)
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
@@ -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
Joshua Lock
AppliedQuoted 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
Signed-off-by Bill Randle <[email protected]>---
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.pyb/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.pyindex 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 = ""
ifos.environ.get('GEN_IMG_MD5')== "True":
cmd += "for x infind " + 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
defgetDeployNames(self, artifact, buildername):