summaryrefslogtreecommitdiffstats
path: root/rpmbuild-remote.py
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-09-08 22:12:37 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-09-08 22:12:37 -0400
commit4ed262019322a56a109d045970f7433e713591d6 (patch)
tree6ff6abca733dee4745131462691f9e575ec0aff5 /rpmbuild-remote.py
parenta850ddeac7376b0f1a63dc269746197f2e56788c (diff)
downloadrpmbuild-remote-4ed262019322a56a109d045970f7433e713591d6.zip
rpmbuild-remote-4ed262019322a56a109d045970f7433e713591d6.tar.gz
rpmbuild-remote-4ed262019322a56a109d045970f7433e713591d6.tar.xz
Clean up sending of files code
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()