summaryrefslogtreecommitdiffstats
path: root/rpmbuild-remote.py
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-09-09 00:33:58 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-09-09 00:33:58 -0400
commite29b9a79ee4814e0f773b43130d5e8d8bbb30b76 (patch)
treeae105d3db3db902db9b83293c19c78ee10991b69 /rpmbuild-remote.py
parent55ae289b5c070e85ec616b7f7d07e3416e2401e0 (diff)
downloadrpmbuild-remote-e29b9a79ee4814e0f773b43130d5e8d8bbb30b76.zip
rpmbuild-remote-e29b9a79ee4814e0f773b43130d5e8d8bbb30b76.tar.gz
rpmbuild-remote-e29b9a79ee4814e0f773b43130d5e8d8bbb30b76.tar.xz
Add functions to fetch results
Diffstat (limited to 'rpmbuild-remote.py')
-rw-r--r--rpmbuild-remote.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py
index b1cacae..e63bbbf 100644
--- a/rpmbuild-remote.py
+++ b/rpmbuild-remote.py
@@ -116,6 +116,12 @@ def get_files(session, files, dest):
sftp.get(file, dest)
sftp.close()
+def get_mock_results(session, dest, sout, serr):
+ pass
+
+def get_rpmbuild_results(session, dest, sout, serr):
+ pass
+
def execute_jobs(opts, system, jobs):
session = paramiko.SSHClient()
LOG.info("Connecting to %(user)s@%(host)s:%(port)d" % system)
@@ -129,10 +135,12 @@ def execute_jobs(opts, system, jobs):
if opts.mock is None:
LOG.info("Building %s" % file)
cmd = "rpmbuild --rebuild rpmbuild/SRPMS/%s" % file
+ fetch = get_mock_results
else:
LOG.info("Building %s with mock config %s" % (file, opts.mock))
cmd = "mock -r %s rpmbuild/SRPMS/%s"
% (opts.mock, file)
+ fetch = get_rpmbuild_results
else:
dest = "rpmbuild/SPECS"
send_files(session, [job[0]], dest)
@@ -141,16 +149,16 @@ def execute_jobs(opts, system, jobs):
file = os.path.basename(job[0])
LOG.info("Building %s from %d souces" % (file, len(job) - 1))
cmd = "rpmbuild -ba rpmbuild/SPECS/%s" % file)
+ fetch = get_rpmbuild_results
start = time.clock()
files = session.exec_command(cmd)
finish = time.clock()
LOG.info("Completed build %.03f seconds" % (finish - start))
LOG.info("Downloading results...")
- # Write output files
- # Fetch RPM files
- # Find "Wrote: " lines in the output
- files = []
- get_files(session, files, opts.dest)
+ files[0].close()
+ fetch(session, dest, files[1], files[2])
+ files[1].close()
+ files[2].close()
session.close()
def main():