summaryrefslogtreecommitdiffstats
path: root/rpmbuild-remote.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpmbuild-remote.py')
-rw-r--r--rpmbuild-remote.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py
index 1dcadb5..8e680af 100644
--- a/rpmbuild-remote.py
+++ b/rpmbuild-remote.py
@@ -114,20 +114,24 @@ def execute_jobs(opts, system, jobs):
session.connect(system['host'], port=system['port'],
username=system['user'], key_filename=system['ssh_key'])
for job in jobs:
- # We have an SRPM
if type(job) == type(''):
- # Send the file to the server
- dest = "$HOME/rpmbuild/SRPMS/"
- send_files([job], dest)
- # Build the SRPM
- # TODO
+ dest = "rpmbuild/SRPMS/"
+ send_files(session, [job], dest)
+ if opts.mock is None:
+ cmd = "rpmbuild --rebuild rpmbuild/SRPMS/%s"
+ % os.path.basename(job)
+ else:
+ cmd = "mock -r %s rpmbuild/SRPMS/%s"
+ % (opts.mock, os.path.basename(job))
else:
- # Send the spec file to the server
- dest = "$HOME/rpmbuild/SPECS"
- send_files([jobs[0]], dest)
- dest = "$HOME/rpmbuild/SOURCES"
- send_files(jobs[1:], dest)
- # Build the RPMs
+ dest = "rpmbuild/SPECS"
+ send_files(session, [jobs[0]], dest)
+ dest = "rpmbuild/SOURCES"
+ send_files(session, jobs[1:], dest)
+ cmd = "rpmbuild -ba rpmbuild/SPECS/%s" % os.path.basename(jobs[0])
+ files = session.exec_command(cmd)
+ # Write output files
+ # Fetch RPM files
def main():
parser = get_parser()