| OLD | NEW |
| 1 # This file is part of Buildbot. Buildbot is free software: you can | 1 # This file is part of Buildbot. Buildbot is free software: you can |
| 2 # redistribute it and/or modify it under the terms of the GNU General Public | 2 # redistribute it and/or modify it under the terms of the GNU General Public |
| 3 # License as published by the Free Software Foundation, version 2. | 3 # License as published by the Free Software Foundation, version 2. |
| 4 # | 4 # |
| 5 # This program is distributed in the hope that it will be useful, but WITHOUT | 5 # This program is distributed in the hope that it will be useful, but WITHOUT |
| 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 8 # details. | 8 # details. |
| 9 # | 9 # |
| 10 # You should have received a copy of the GNU General Public License along with | 10 # You should have received a copy of the GNU General Public License along with |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 def do_stop(r): | 40 def do_stop(r): |
| 41 result.append(r) | 41 result.append(r) |
| 42 reactor.stop() | 42 reactor.stop() |
| 43 d.addBoth(do_stop) | 43 d.addBoth(do_stop) |
| 44 reactor.callWhenRunning(async) | 44 reactor.callWhenRunning(async) |
| 45 reactor.run() | 45 reactor.run() |
| 46 return result[0] | 46 return result[0] |
| 47 return wrap | 47 return wrap |
| 48 | 48 |
| 49 def isBuildmasterDir(dir): | 49 def isBuildmasterDir(dir): |
| 50 buildbot_tac = os.path.join(dir, "buildbot.tac") | 50 buildbot_tac = os.path.join(dir, "master.cfg") |
| 51 if not os.path.isfile(buildbot_tac): | 51 if not os.path.isfile(buildbot_tac): |
| 52 print "no buildbot.tac" | 52 print "no master.cfg" |
| 53 return False | 53 return False |
| 54 | 54 |
| 55 contents = open(buildbot_tac, "r").read() | 55 contents = open(buildbot_tac, "r").read() |
| 56 return "Application('buildmaster')" in contents | 56 return "Application('buildmaster')" in contents |
| 57 | 57 |
| 58 # the create/start/stop commands should all be run as the same user, | 58 # the create/start/stop commands should all be run as the same user, |
| 59 # preferably a separate 'buildbot' account. | 59 # preferably a separate 'buildbot' account. |
| 60 | 60 |
| 61 # Note that the terms 'options' and 'config' are used intechangeably here - in | 61 # Note that the terms 'options' and 'config' are used intechangeably here - in |
| 62 # fact, they are intercanged several times. Caveat legator. | 62 # fact, they are intercanged several times. Caveat legator. |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 old_contents = open(target, "rt").read() | 308 old_contents = open(target, "rt").read() |
| 309 if old_contents != new_contents: | 309 if old_contents != new_contents: |
| 310 if overwrite: | 310 if overwrite: |
| 311 if not self.quiet: | 311 if not self.quiet: |
| 312 print "%s has old/modified contents" % target | 312 print "%s has old/modified contents" % target |
| 313 print " overwriting it with new contents" | 313 print " overwriting it with new contents" |
| 314 open(target, "wt").write(new_contents) | 314 open(target, "wt").write(new_contents) |
| 315 else: | 315 else: |
| 316 if not self.quiet: | 316 if not self.quiet: |
| 317 print "%s has old/modified contents" % target | 317 print "%s has old/modified contents" % target |
| 318 print " writing new contents to %s.new" % target | |
| 319 open(target + ".new", "wt").write(new_contents) | |
| 320 # otherwise, it's up to date | 318 # otherwise, it's up to date |
| 321 else: | 319 else: |
| 322 if not self.quiet: | 320 if not self.quiet: |
| 323 print "populating %s" % target | 321 print "populating %s" % target |
| 324 open(target, "wt").write(new_contents) | 322 open(target, "wt").write(new_contents) |
| 325 | 323 |
| 326 def move_if_present(self, source, dest): | 324 def move_if_present(self, source, dest): |
| 327 if os.path.exists(source): | 325 if os.path.exists(source): |
| 328 if os.path.exists(dest): | 326 if os.path.exists(dest): |
| 329 print "Notice: %s now overrides %s" % (dest, source) | 327 print "Notice: %s now overrides %s" % (dest, source) |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 statusgui(so) | 1248 statusgui(so) |
| 1251 elif command == "try": | 1249 elif command == "try": |
| 1252 doTry(so) | 1250 doTry(so) |
| 1253 elif command == "tryserver": | 1251 elif command == "tryserver": |
| 1254 doTryServer(so) | 1252 doTryServer(so) |
| 1255 elif command == "checkconfig": | 1253 elif command == "checkconfig": |
| 1256 if not doCheckConfig(so): | 1254 if not doCheckConfig(so): |
| 1257 sys.exit(1) | 1255 sys.exit(1) |
| 1258 sys.exit(0) | 1256 sys.exit(0) |
| 1259 | 1257 |
| OLD | NEW |