From ac2eeb63fff5d21dd584e96e0a14a45792d73cf9 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 18 Jun 2010 16:33:50 -0700 Subject: Wire up import in the frontend. Does not commit yet, leaving that up to the user for now. --- src/fedpkg.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/fedpkg.py') diff --git a/src/fedpkg.py b/src/fedpkg.py index 9ee8d84..1c1f0af 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -433,6 +433,26 @@ def gimmespec(args): log.error('Could not get spec file: %s' % e) sys.exit(1) +def import_srpm(args): + # See if we need to create a module from scratch, and do so + if args.create: + log.warning('Not implimented yet.') + sys.exit(0) + if not args.create: + try: + mymodule = pyfedpkg.PackageModule(args.path) + if not mymodule.import_srpm(args.srpm): + print("New content staged and new sources uploaded.") + print("Review with: git diff --cached") + print("Commit if happy or revert with: git reset --hard HEAD") + return + else: + log.error("Unable to import srpm") + sys.exit(1) + except pyfedpkg.FedpkgError, e: + log.error('Could import srpm: %s' % e) + sys.exit(1) + def install(args): arch = None short = False @@ -688,6 +708,19 @@ packages will be built sequentially. help = 'print spec file name') parser_gimmespec.set_defaults(command = gimmespec) + # Import content into a module + parser_import_srpm = subparsers.add_parser('import', + help = 'Import content into a module') + parser_import_srpm.add_argument('--branch', '-b', + help = 'Branch to import onto', + default = 'devel') + parser_import_srpm.add_argument('--create', '-c', + help = 'Create a new local repo', + action = 'store_true') + parser_import_srpm.add_argument('srpm', + help = 'Source rpm to import') + parser_import_srpm.set_defaults(command = import_srpm) + # install locally parser_install = subparsers.add_parser('install', help = 'Local test rpmbuild install') -- cgit