summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-06-18 16:33:50 -0700
committerJesse Keating <jkeating@redhat.com>2010-06-18 16:34:54 -0700
commitac2eeb63fff5d21dd584e96e0a14a45792d73cf9 (patch)
treef1f835feb1f13c62404f6e9a4d64a9ab5611f103 /src/fedpkg.py
parent7a58893d504ffea59157c4873f62a0ebef7458d9 (diff)
downloadfedora-packager-ac2eeb63fff5d21dd584e96e0a14a45792d73cf9.zip
fedora-packager-ac2eeb63fff5d21dd584e96e0a14a45792d73cf9.tar.gz
fedora-packager-ac2eeb63fff5d21dd584e96e0a14a45792d73cf9.tar.xz
Wire up import in the frontend.
Does not commit yet, leaving that up to the user for now.
Diffstat (limited to 'src/fedpkg.py')
-rwxr-xr-xsrc/fedpkg.py33
1 files changed, 33 insertions, 0 deletions
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')