From 12da150367d5481a964c6f17d73c70f306b60dde Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Jan 06 2021 22:01:05 +0000 Subject: Add --skip-nvr-check to the scratch-build command When building in EPEL7 for the different target system, the build sometimes fails with unknown or missing macro/tag. This allows the packager to skip this rpm fail and continue with '--skip-nvr-check' argument. Previously it was allowed for subcommands build and chain-build. Now, argument parsing code could be moved to the common method. JIRA: RHELCMP-593 Resolves: rhbz#1671012 Signed-off-by: Ondrej Nosek --- diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 161b351..e6ba0c6 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -513,6 +513,12 @@ class cliClient(object): '--skip-remote-rules-validation', action='store_true', default=False, help=("Don't check if there's a valid gating.yaml file in the repo, where you can " "define additional policies for Greenwave gating.")) + self.build_parser_common.add_argument( + '--skip-nvr-check', action='store_false', default=True, + dest='nvr_check', + help='Submit build to buildsystem without check if NVR was ' + 'already built. NVR is constructed locally and may be ' + 'different from NVR constructed during build on builder.') def register_rpm_common(self): """Create a common parser for rpm commands""" @@ -544,12 +550,6 @@ class cliClient(object): 'to build for based on branch data, and uses the ' 'latest commit as the build source.') build_parser.add_argument( - '--skip-nvr-check', action='store_false', default=True, - dest='nvr_check', - help='Submit build to buildsystem without check if NVR was ' - 'already built. NVR is constructed locally and may be ' - 'different from NVR constructed during build on builder.') - build_parser.add_argument( '--skip-tag', action='store_true', default=False, help='Do not attempt to tag package') build_parser.add_argument( @@ -588,12 +588,6 @@ class cliClient(object): defined, packages will be built sequentially. """ % {'name': self.name})) chainbuild_parser.add_argument( - '--skip-nvr-check', action='store_false', default=True, - dest='nvr_check', - help='Submit build to buildsystem without check if NVR was ' - 'already built. NVR is constructed locally and may be ' - 'different from NVR constructed during build on builder.') - chainbuild_parser.add_argument( 'package', nargs='+', help='List the packages and order you want to build in') chainbuild_parser.set_defaults(command=self.chainbuild) diff --git a/pyrpkg/layout/layouts.py b/pyrpkg/layout/layouts.py index 7f5b8ef..a7b9f9c 100644 --- a/pyrpkg/layout/layouts.py +++ b/pyrpkg/layout/layouts.py @@ -83,7 +83,7 @@ class SRPMLayout(BaseLayout): class IncompleteLayout(BaseLayout): """ This layout is possibly missing specfile(s) or some other essentials - of previous layouts. Doesn't have to be retired yet. Just enough layout + of previous layouts. Must not be retired yet. Just enough layout to allow run 'retire' command. """ def __init__(self, root_dir=None, sources_file_template='sources'):