Skip to content

Commit

Permalink
Merge branch 'win32-fixes' of git://github.com/dionorgua/buildbot
Browse files Browse the repository at this point in the history
* 'win32-fixes' of git://github.com/dionorgua/buildbot:
  Fix removing of broken "junctions" on Windows
  Prevent unhandled error when sighup'ing without specified category

Additional fixes to make PyFlakes happy on POSIX systems
  • Loading branch information
djmitche committed Dec 23, 2010
2 parents 0059610 + 2773a72 commit d1d05b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions master/buildbot/process/builder.py
Expand Up @@ -472,8 +472,8 @@ def compareToSetup(self, setup):
diffs.append('logHorizon changed from %s to %s' % (self.logHorizon, setup['logHorizon']))
if setup['eventHorizon'] != self.eventHorizon:
diffs.append('eventHorizon changed from %s to %s' % (self.eventHorizon, setup['eventHorizon']))
if setup['category'] != self.category:
diffs.append('category changed from %r to %r' % (self.category, setup['category']))
if setup.get('category', None) != self.category:
diffs.append('category changed from %r to %r' % (self.category, setup.get('category', None)))

return diffs

Expand Down
13 changes: 12 additions & 1 deletion slave/buildslave/commands/utils.py
Expand Up @@ -38,6 +38,10 @@ def getCommand(name):
return possibles_exe[0]
return possibles[0]

# this just keeps pyflakes happy on non-Windows systems
if runtime.platformType != 'win32':
WindowsError = RuntimeError

if runtime.platformType == 'win32':
def rmdirRecursive(dir):
"""This is a replacement for shutil.rmtree that works better under
Expand All @@ -60,7 +64,14 @@ def rmdirRecursive(dir):
except:
log.msg("rmdirRecursive: decoding from UTF-8 failed")

for name in os.listdir(dir):
try:
list = os.listdir(dir)
except WindowsError, e:
log.msg("rmdirRecursive: unable to listdir %s (%s). Trying to remove like a dir" % (dir, e.strerror))
os.rmdir(dir)
return

for name in list:
full_name = os.path.join(dir, name)
# on Windows, if we don't have write permission we can't remove
# the file/directory either, so turn that on
Expand Down

0 comments on commit d1d05b4

Please sign in to comment.