Add rhel-target none option

Signed-off-by: Troy Dawson <tdawson@redhat.com>
This commit is contained in:
Troy Dawson 2023-09-07 09:36:01 -07:00
parent 790841602b
commit e25a639d57

View file

@ -202,27 +202,30 @@ class centpkgClient(cliClient):
* zstream - If pre-GA of a y-stream release, this will build for 0day. * zstream - If pre-GA of a y-stream release, this will build for 0day.
If post-GA of a Y-stream release, this will build for the Z-stream of that release. If post-GA of a Y-stream release, this will build for the Z-stream of that release.
* latest - This will always build for the next Y-stream release * latest - This will always build for the next Y-stream release
* none - This will not build in brew. No rhel metadata is set.
'''.format('\n'.join(textwrap.wrap(build_parser.description)))) '''.format('\n'.join(textwrap.wrap(build_parser.description))))
# Now add our additional option # Now add our additional option
build_parser.add_argument( build_parser.add_argument(
'--rhel-target', '--rhel-target',
choices=['exception', 'zstream', 'latest'], choices=['exception', 'zstream', 'latest', 'none'],
help='Set the rhel-target metadata') help='Set the rhel-target metadata')
# Overloaded _build # Overloaded _build
def _build(self, sets=None): def _build(self, sets=None):
# Only do rhel-target if we are centpkg, not centpkg-sig # Only do rhel-target if we are centpkg, not centpkg-sig, or if we are doing scratch
if not os.path.basename(sys.argv[0]).endswith('-sig') and not self.args.scratch: if not os.path.basename(sys.argv[0]).endswith('-sig') and not self.args.scratch:
# Only run if we have internal configuraions, or scratch # Only run if we have internal configuraions
internal_config_file = "/etc/rpkg/centpkg_internal.conf" internal_config_file = "/etc/rpkg/centpkg_internal.conf"
if os.path.exists(internal_config_file): if os.path.exists(internal_config_file):
# If rhel-target is set, no need to check, just use it # If rhel-target is set, no need to check, just use it
if hasattr(self.args, 'rhel_target') and self.args.rhel_target: if hasattr(self.args, 'rhel_target') and self.args.rhel_target:
# If rhel-target set to none, do nothing with metadata
if self.args.rhel_target.lower() != "none":
# If custom-user-metadata set, add onto it # If custom-user-metadata set, add onto it
if hasattr(self.args, 'custom_user_metadata') and self.args.custom_user_metadata: if hasattr(self.args, 'custom_user_metadata') and self.args.custom_user_metadata:
try: try: