summaryrefslogtreecommitdiffstats
path: root/rpmbuild-remote.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpmbuild-remote.py')
-rw-r--r--rpmbuild-remote.py22
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()