| |
@@ -24,7 +24,13 @@
|
| |
import centpkg.cli
|
| |
|
| |
|
| |
- def main():
|
| |
+ def main(sig: bool):
|
| |
+ """
|
| |
+ Centpkg main.
|
| |
+
|
| |
+ Params:
|
| |
+ sig: Flag to switch between centpkg-sig and centpkg.
|
| |
+ """
|
| |
# Setup an argparser and parse the known commands to get the config file
|
| |
program_name = os.path.basename(sys.argv[0])
|
| |
|
| |
@@ -32,20 +38,16 @@
|
| |
# of commandline arguments with common prefix). Generaly it is available since python3.6.
|
| |
# This enables "allow_abbrev" for older python versions.
|
| |
parser = pyrpkg.cli.ArgumentParser(add_help=False)
|
| |
- parser.add_argument('-S', '--sig', help='Operate as a CentOS SIG user instead of using the Stream distro environment',
|
| |
- default=False,
|
| |
- action='store_true')
|
| |
- parser.add_argument('-C', '--config', help='Specify a config file to use')
|
| |
+ if sig:
|
| |
+ parser.add_argument('-C', '--config', help='Specify a config file to use',
|
| |
+ default='/etc/rpkg/centpkg-sig.conf')
|
| |
+ else:
|
| |
+ parser.add_argument('-C', '--config', help='Specify a config file to use',
|
| |
+ default='/etc/rpkg/centpkg.conf')
|
| |
|
| |
|
| |
(args, other) = parser.parse_known_args()
|
| |
|
| |
- if not args.config:
|
| |
- if args.sig:
|
| |
- args.config = '/etc/rpkg/centpkg-sig.conf'
|
| |
- else:
|
| |
- args.config = '/etc/rpkg/centpkg.conf'
|
| |
-
|
| |
# Make sure we have a sane config file
|
| |
if not os.path.exists(args.config) and not other[-1] in ['--help', '-h', 'help']:
|
| |
sys.stderr.write('Invalid config file %s\n' % args.config)
|
| |
@@ -55,7 +57,10 @@
|
| |
config = ConfigParser.SafeConfigParser()
|
| |
config.read(args.config)
|
| |
|
| |
- client = centpkg.cli.centpkgClient(config)
|
| |
+ if sig:
|
| |
+ client = centpkg.cli.centpkgClientSig(config)
|
| |
+ else:
|
| |
+ client = centpkg.cli.centpkgClient(config)
|
| |
client.do_imports(site='centpkg')
|
| |
client.parse_cmdline()
|
| |
|
| |
Add executable centpkg-sig which allows user to interact with CentOS
Linux dist-git and CentOS Linux koji instance.
Signed-off-by: Michal Kone?ný mkonecny@redhat.com