mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-24 00:32:55 +00:00
Add centpkg-sig
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>
This commit is contained in:
parent
b6d333ab47
commit
0d832c631a
8 changed files with 76 additions and 23 deletions
18
README.md
18
README.md
|
@ -10,6 +10,14 @@ For now only a very small subset of rpkg commands are enabled.
|
||||||
Exception handling at the top level has been disabled for now to get better
|
Exception handling at the top level has been disabled for now to get better
|
||||||
tracebacks during development.
|
tracebacks during development.
|
||||||
|
|
||||||
|
This repository provides two executable scripts centpkg and centpkg-sig.
|
||||||
|
|
||||||
|
## centpkg
|
||||||
|
Executable centpkg allows you to interact with CentOS Stream dist-git and CentOS Stream koji instance.
|
||||||
|
|
||||||
|
## centpkg-sig
|
||||||
|
Executable centpkg-sig allows you to interact with CentOS Linux dist-git and CentOS Linux koji instance.
|
||||||
|
|
||||||
## Supported commands
|
## Supported commands
|
||||||
Here is the list currently supported commands by centpkg:
|
Here is the list currently supported commands by centpkg:
|
||||||
|
|
||||||
|
@ -17,17 +25,21 @@ Here is the list currently supported commands by centpkg:
|
||||||
* sources
|
* sources
|
||||||
* new-sources
|
* new-sources
|
||||||
|
|
||||||
|
Here is the list currently supported commands by centpkg-sig:
|
||||||
|
|
||||||
|
* clone
|
||||||
|
|
||||||
## Current workflow
|
## Current workflow
|
||||||
For a sig working on a package in git.centos.org, the following workflow is
|
For a sig working on a package in git.centos.org, the following workflow is
|
||||||
recommended:
|
recommended:
|
||||||
|
|
||||||
# In this example a member of the virt sig would like to scratch-build a2ps on EL6
|
# In this example a member of the virt sig would like to scratch-build a2ps on EL6
|
||||||
$ centpkg clone -b virt6 a2ps
|
$ centpkg-sig clone -b virt6 a2ps
|
||||||
$ cd a2ps
|
$ cd a2ps
|
||||||
$ centpkg build --srpm --scratch
|
$ centpkg-sig build --srpm --scratch
|
||||||
|
|
||||||
# Tagged builds can be done also
|
# Tagged builds can be done also
|
||||||
$ centpkg build --srpm
|
$ centpkg-sig build --srpm
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -28,7 +28,7 @@ BuildRequires: python-devel, python-setuptools
|
||||||
BuildRequires: pyrpkg
|
BuildRequires: pyrpkg
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Provides the centpkg command for working with dist-git
|
Provides the centpkg and centpkg-sig commands for working with dist-git
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -c
|
%setup -q -c
|
||||||
|
@ -48,11 +48,15 @@ rm -rf %{buildroot}
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc README.md COPYING
|
%doc README.md COPYING
|
||||||
%config %{_sysconfdir}/rpkg/centpkg.conf
|
%config %{_sysconfdir}/rpkg/centpkg.conf
|
||||||
|
%config %{_sysconfdir}/rpkg/centpkg-sig.conf
|
||||||
%{_bindir}/%{name}
|
%{_bindir}/%{name}
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/*
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 25 2021 mkonecny@redhat.com 0.5.0-1
|
||||||
|
- Add centpkg-sig command
|
||||||
|
|
||||||
* Mon Nov 28 2016 brian@bstinson.com 0.4.6-1
|
* Mon Nov 28 2016 brian@bstinson.com 0.4.6-1
|
||||||
- Tracking updates to rpkg (thanks pavlix)
|
- Tracking updates to rpkg (thanks pavlix)
|
||||||
- Fix the URL building code in the sources method
|
- Fix the URL building code in the sources method
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -40,6 +40,6 @@ setup(
|
||||||
package_dir={'': 'src'},
|
package_dir={'': 'src'},
|
||||||
packages=['centpkg'],
|
packages=['centpkg'],
|
||||||
install_requires=get_requirements(),
|
install_requires=get_requirements(),
|
||||||
scripts=['src/bin/centpkg'],
|
scripts=['src/bin/centpkg', 'src/bin/centpkg-sig'],
|
||||||
data_files=[('/etc/rpkg',['src/centpkg.conf']),]
|
data_files=[('/etc/rpkg',['src/centpkg.conf', 'src/centpkg-sig.conf']),]
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,5 +16,5 @@
|
||||||
from centpkg.__main__ import main
|
from centpkg.__main__ import main
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main(sig=False)
|
||||||
|
|
||||||
|
|
21
src/bin/centpkg-sig
Normal file
21
src/bin/centpkg-sig
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
'''
|
||||||
|
centpkg - a script to interact with CentOS Packages
|
||||||
|
'''
|
||||||
|
#
|
||||||
|
# Author(s):
|
||||||
|
# Brian Stinson <bstinson@ksu.edu>
|
||||||
|
# Pat Riehecky <riehecky@fnal.gov>
|
||||||
|
# Michal Konecny <michal.konecny@psmail.xyz>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
|
||||||
|
# the full text of the license.
|
||||||
|
|
||||||
|
from centpkg.__main__ import main
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main(sig=True)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[centpkg]
|
[centpkg-sig]
|
||||||
lookaside = https://git.centos.org/sources
|
lookaside = https://git.centos.org/sources
|
||||||
lookasidehash = sha512
|
lookasidehash = sha512
|
||||||
lookaside_cgi = https://git.centos.org/sources/upload.cgi
|
lookaside_cgi = https://git.centos.org/sources/upload.cgi
|
||||||
|
|
|
@ -24,7 +24,13 @@ import pyrpkg.utils
|
||||||
import centpkg.cli
|
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
|
# Setup an argparser and parse the known commands to get the config file
|
||||||
program_name = os.path.basename(sys.argv[0])
|
program_name = os.path.basename(sys.argv[0])
|
||||||
|
|
||||||
|
@ -32,20 +38,16 @@ def main():
|
||||||
# of commandline arguments with common prefix). Generaly it is available since python3.6.
|
# of commandline arguments with common prefix). Generaly it is available since python3.6.
|
||||||
# This enables "allow_abbrev" for older python versions.
|
# This enables "allow_abbrev" for older python versions.
|
||||||
parser = pyrpkg.cli.ArgumentParser(add_help=False)
|
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',
|
if sig:
|
||||||
default=False,
|
parser.add_argument('-C', '--config', help='Specify a config file to use',
|
||||||
action='store_true')
|
default='/etc/rpkg/centpkg-sig.conf')
|
||||||
parser.add_argument('-C', '--config', help='Specify a config file to use')
|
else:
|
||||||
|
parser.add_argument('-C', '--config', help='Specify a config file to use',
|
||||||
|
default='/etc/rpkg/centpkg.conf')
|
||||||
|
|
||||||
|
|
||||||
(args, other) = parser.parse_known_args()
|
(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
|
# Make sure we have a sane config file
|
||||||
if not os.path.exists(args.config) and not other[-1] in ['--help', '-h', 'help']:
|
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)
|
sys.stderr.write('Invalid config file %s\n' % args.config)
|
||||||
|
@ -55,6 +57,9 @@ def main():
|
||||||
config = ConfigParser.SafeConfigParser()
|
config = ConfigParser.SafeConfigParser()
|
||||||
config.read(args.config)
|
config.read(args.config)
|
||||||
|
|
||||||
|
if sig:
|
||||||
|
client = centpkg.cli.centpkgClientSig(config)
|
||||||
|
else:
|
||||||
client = centpkg.cli.centpkgClient(config)
|
client = centpkg.cli.centpkgClient(config)
|
||||||
client.do_imports(site='centpkg')
|
client.do_imports(site='centpkg')
|
||||||
client.parse_cmdline()
|
client.parse_cmdline()
|
||||||
|
|
|
@ -28,7 +28,18 @@ class centpkgClient(cliClient):
|
||||||
self.register_parser()
|
self.register_parser()
|
||||||
|
|
||||||
def register_parser(self):
|
def register_parser(self):
|
||||||
self.parser.add_argument('-S', '--sig', help='Operate as a CentOS SIG user instead of using the Stream distro environment',
|
pass
|
||||||
default=False,
|
|
||||||
action='store_true')
|
|
||||||
|
|
||||||
|
|
||||||
|
class centpkgClientSig(cliClient):
|
||||||
|
def __init__(self, config, name=None):
|
||||||
|
self.DEFAULT_CLI_NAME = 'centpkg-sig'
|
||||||
|
super(centpkgClientSig, self).__init__(config, name)
|
||||||
|
|
||||||
|
self.setup_centos_subparsers()
|
||||||
|
|
||||||
|
def setup_centos_subparsers(self):
|
||||||
|
self.register_parser()
|
||||||
|
|
||||||
|
def register_parser(self):
|
||||||
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue