From 5a5b8a85aa5d073023e71e28bdc5b0b224eae359 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 7 Feb 2009 23:39:47 -0500 Subject: Added config boilerplate --- rpmbuild-remote.py | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'rpmbuild-remote.py') diff --git a/rpmbuild-remote.py b/rpmbuild-remote.py index 4f01af5..1b7b762 100644 --- a/rpmbuild-remote.py +++ b/rpmbuild-remote.py @@ -2,11 +2,51 @@ # -*- coding: utf-8 -*- from iniparse import INIConfig +import paramiko import getopt import sys +import os + +def usage(): + print """ +rpmbuild-remote : Build an RPM on a remote system + + rpmbuild-remote [options]... ... + + --help Print this message + -c, --config Configuration file to use for the build. + Default: ~/.rpmbuild-remote + -s, --system The remote machine to use (defined in config + file) + -u, --user The username on the remote system + Default: current user + -h, --host The hostname/IP of the remote system + -p, --port The port to use on the remote system + Default: 21 + -d, --dest Directory to place resulting files + Default: ~/rpmbuild-remote/ + -m, --mock Use mock (only applies to SRPM files) + Default: None + files The list of files can contain either SRPM + files or a list starting with a spec file and + followed by sources for the package. +""" def main(argv): - config = INIConfig() + try: + opts, args = getopts.getopts(argv, "c:s:u:h:p:d:m:", ['config=', 'system=', 'user=', 'host=', 'port=', 'dest=', 'mock=']) + except getopt.GetoptError, err: + print str(err) + usage() + sys.exit(1) + home = os.path.expanduser('~') + config = os.path.join(home, '.rpmbuild-remote') + system = '' + user = os.getlogin() + host = '' + port = 21 + dest = os.path.join(home, 'rpmbuild-remote') + mock = '' if __name__ == '__main__': main(sys.argv[1:]) -- cgit