diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-09-09 01:12:24 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-09-09 01:12:24 -0400 |
commit | b8ff9e0aeca4d329efcd1fb48fa3de961545b51f (patch) | |
tree | 245356bae8934e14d84eb56aff80a247527af4b4 /rpmbuild-remote.py | |
parent | a468f75d33efb2a6dcaf4c4348e9894fc5270fe7 (diff) | |
download | rpmbuild-remote-b8ff9e0aeca4d329efcd1fb48fa3de961545b51f.tar.gz rpmbuild-remote-b8ff9e0aeca4d329efcd1fb48fa3de961545b51f.tar.xz rpmbuild-remote-b8ff9e0aeca4d329efcd1fb48fa3de961545b51f.zip |
Fetch the files
Diffstat (limited to 'rpmbuild-remote.py')
-rw-r--r-- | rpmbuild-remote.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index 7d3304c..9df2d32 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -116,11 +116,35 @@ def get_files(session, files, dest): sftp.get(file, dest) sftp.close() +def log_regex(build_output): + out = open(build_output, 'r') + regex = re.compile("Wrote: (.+)") + files = regex.findall(out.readall()) + out.close() + def get_mock_results(session, dest, sout, serr): - pass + os.mkdirs(dest) + out = open(os.path.join(dest, 'mock.stdout'), 'w+') + out.write(sout.readall()) + out.close() + err = open(os.path.join(dest, 'mock.stderr'), 'w+') + err.write(serr.readall()) + err.close() + output_dir = re.compile(r'INFO: Results and/or logs in: (.+)').group(1) + logs = [os.path.join(output_dir, x) + for x in ['build.log', 'root.log', 'state.log']] + get_files(session, logs, dest) + get_files(os.path.join(dest, 'build.log'), dest) def get_rpmbuild_results(session, dest, sout, serr): - pass + os.mkdirs(dest) + out = open(os.path.join(dest, 'rpmbuild.stdout', 'w+')) + out.write(sout.readall()) + out.close() + err = open(os.path.join(dest, 'rpmbuild.stderr', 'w+')) + err.write(serr.readall()) + err.close() + get_files(os.path.join(dest, 'rpmbuild.stdout'), dest) def execute_jobs(opts, system, jobs): session = paramiko.SSHClient() |