Skip to content

Commit

Permalink
use 'find $foo -exec chmod u+rwx {} ;' on FreeBSD
Browse files Browse the repository at this point in the history
chmod -Rf wasn't a complete solution
  • Loading branch information
Dustin J. Mitchell committed Feb 4, 2010
1 parent adf8c8f commit 7761c32
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions buildbot/slave/commands.py
Expand Up @@ -1625,11 +1625,15 @@ def doClobberTryChmodIfFail(self, rc, dirname):
assert isinstance(rc, int)
if rc == 0:
return defer.succeed(0)
# Attempt a recursive chmod and re-try the rm -rf after. The '-f' here
# works around a broken 'chmod -R' on FreeBSD (it tries to recurse into a
# directory for which it doesn't have permission, before changing that
# permission)
# Attempt a recursive chmod and re-try the rm -rf after.

command = ["chmod", "-Rf", "u+rwx", os.path.join(self.builder.basedir, dirname)]
if sys.platform.startswith('freebsd'):
# Work around a broken 'chmod -R' on FreeBSD (it tries to recurse into a
# directory for which it doesn't have permission, before changing that
# permission) by running 'find' instead
command = ["find", os.path.join(self.builder.basedir, dirname),
'-exec', 'chmod', 'u+rwx', '{}', ';' ]
c = ShellCommand(self.builder, command, self.builder.basedir,
sendRC=0, timeout=self.timeout, maxTime=self.maxTime,
usePTY=False)
Expand Down

0 comments on commit 7761c32

Please sign in to comment.