From 45bc456bb625c778e579ee417661c8105c7eeb12 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 8 Sep 2009 21:34:02 -0400 Subject: Add skeleton code to execute the jobs --- rpmbuild-remote.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'rpmbuild-remote.py') diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index 845bc3f..c4e90b7 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -104,6 +104,26 @@ def read_preferences(options): system['port'] = options.port return system +def execute_jobs(system, jobs): + session = paramiko.SSHClient() + 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 + 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 + def main(): parser = get_parser() opts, args = parser.parse_args() @@ -122,7 +142,9 @@ def main(): LOG.error("Source file given without spec file.") sys.exit(1) jobs[-1].append(arg) + # Read the preferences file system = read_preferences(opts) + execute_jobs(system, jobs) if __name__ == '__main__': main() -- cgit