diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-09-08 21:34:02 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-09-08 21:34:02 -0400 |
commit | 45bc456bb625c778e579ee417661c8105c7eeb12 (patch) | |
tree | fa10d48362f25e6e55fc0063fdcc244318ae8037 | |
parent | b70e96f6c581983270268ed3b4f1b39c17f1be5c (diff) | |
download | rpmbuild-remote-45bc456bb625c778e579ee417661c8105c7eeb12.tar.gz rpmbuild-remote-45bc456bb625c778e579ee417661c8105c7eeb12.tar.xz rpmbuild-remote-45bc456bb625c778e579ee417661c8105c7eeb12.zip |
Add skeleton code to execute the jobs
-rw-r--r-- | rpmbuild-remote.py | 22 |
1 files changed, 22 insertions, 0 deletions
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() |