# HG changeset patch # User Jan Nieuwenhuizen # Date 1178718054 -7200 # Node ID 07510997bd2f001a28d09c500b3e47af3ddb8a52 # Parent 12f3f2b0a16bc13c7e5c0293d47efed19c1c7182 Remove Log_file, use oslog. diff -r 12f3f2b0a16b -r 07510997bd2f TODO --- a/TODO Wed May 09 13:28:16 2007 +0200 +++ b/TODO Wed May 09 15:40:54 2007 +0200 @@ -1,3 +1,5 @@ +* Add diff option: 561096638b3718af86d61570ac63bafa5c4a99f8 + * Make gub-tester work with plain, user-checked-out repositories again? * Softcode stages. @@ -19,6 +21,16 @@ * Bootstrap whole toolchain from source on more platforms (freebsd)? +* Fix configure/make command env var settings (grep FIXME) + + @subst_method + def CFLAGS(self): + return 'bla' + +or + + def init(self): + self.CFLAGS='bla' LOWER PRIORITY diff -r 12f3f2b0a16b -r 07510997bd2f bin/gub-tester --- a/bin/gub-tester Wed May 09 13:28:16 2007 +0200 +++ b/bin/gub-tester Wed May 09 15:40:54 2007 +0200 @@ -21,6 +21,7 @@ from gub import repository +from gub import oslog ################################################################ @@ -44,22 +45,6 @@ canonicalize = re.sub ('[^a-zA-Z0-9-]+', '_', canonicalize) return canonicalize -class LogFile: - def __init__ (self, name): - if name: - self.file = open (name, 'a') - else: - self.file = sys.stdout - - self.prefix = 'gub-tester [%d]: ' % os.getpid () - - def log (self, msg): - self.file.write ('%s%s\n' % (self.prefix, msg)) - self.file.flush () - - def __del__ (self): - self.log (' *** finished') - log_file = None ################################################################ @@ -218,6 +203,8 @@ help='Where to store databases test results', default='log') + p.add_option ('-v', '--verbose', action='count', dest='verbose', default=0) + return p @@ -235,16 +222,16 @@ done_db = get_db (options, canonicalize) if done_db.has_key (release_hash): - log_file.log ('release %(release_hash)s has already been checked' + log_file.info ('release %(release_hash)s has already been checked' % locals ()) return None logfile = 'test-%(canonicalize)s.log' % locals () logfile = os.path.join (options.result_dir, logfile) - cmd = '(nice time %(target)s) > %(logfile)s 2>&1' % locals () + cmd = 'nice time sh -c "(%(target)s)" > %(logfile)s 2>&1' % locals () - log_file.log (cmd) + log_file.command (cmd) if options.dry_run: return ('SUCCESS', ['dryrun']) @@ -266,14 +253,14 @@ % (target, '\n'.join (body[-10:]))] - log_file.log ('%s: %s' % (target, result)) + log_file.info ('%s: %s' % (target, result)) done_db[release_hash] = time.ctime () return (result, attachments) def send_message (options, msg): if not options.address: - log_file.log ('No recipients for result mail') + log_file.info ('No recipients for result mail') return COMMASPACE = ', ' @@ -299,14 +286,14 @@ def real_main (options, args, handle_result): global log_file - log = 'log/test-gubb.log' + log = 'log/gub-tester.log' if options.dry_run: - log = '' + log = '/dev/stdout' - log_file = LogFile (log) + log_file = oslog.Os_commands (log, options.verbose) - log_file.log (' *** %s' % time.ctime ()) - log_file.log (' *** Starting tests:\n %s' % '\n '.join (args)) + log_file.info (' *** %s' % time.ctime ()) + log_file.info (' *** Starting tests:\n %s' % '\n '.join (args)) repo = repository.get_repository_proxy (options.repository, options.url, @@ -317,7 +304,7 @@ repo.download () repo.update_workdir ('.') - log_file.log ('Repository %s' % str (repo)) + log_file.info ('Repository %s' % str (repo)) last_patch = repo.get_revision_description () release_hash = repo.get_checksum ()