From a8695f47f2788433a4ce2296e511d3513392b1af Mon Sep 17 00:00:00 2001 From: David Vierra Date: Thu, 5 Nov 2015 02:52:00 -1000 Subject: [PATCH] Fix `find: paths must precede expression` error in RemovePYCs. If the working directory for a RemovePYCs build step contains any files matching `*.pyc`, the wildcard will be expanded by the shell before running the `find` command. This results in the build step only removing a single file if there is a .pyc file in the working dir, or failing to run at all with a `paths must precede expression` error if there is more than one such file. In my case, the command would expand to `find . -name setup_mceditlib.pyc setup_mcedit2.pyc -exec rm {} ;` which gives a `paths must precede expression` error. This change encloses the wildcard pattern with single-quotes to prevent the shell from expanding them. --- master/buildbot/steps/python_twisted.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master/buildbot/steps/python_twisted.py b/master/buildbot/steps/python_twisted.py index 4eb637cdb38..d9c11758732 100644 --- a/master/buildbot/steps/python_twisted.py +++ b/master/buildbot/steps/python_twisted.py @@ -544,6 +544,6 @@ def describe(self, done=False): class RemovePYCs(ShellCommand): name = "remove-.pyc" - command = ['find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';'] + command = ['find', '.', '-name', "'*.pyc'", '-exec', 'rm', '{}', ';'] description = ["removing", ".pyc", "files"] descriptionDone = ["remove", ".pycs"]