#740 `rhpkg mockbuild` won't show a hint with '--target'
Merged by onosek. Opened by onosek.
onosek/rpkg standalone_mock-config  into  master

Download 740.patch

When the build target is not found, a hint suggesting '--target'
option is incorrect, because such an option is not supported for
mockbuild.
The 'target' option is only possible for mock-config.
For mockbuild, a modified hint is shown suggesting '--release'
option instead.

JIRA: RHELCMP-13842

Signed-off-by: Ondřej Nosek onosek@redhat.com

Generally looks okay to me. The default behaviour of the method is changed. Is that going to be okay with all callers? I think it should be, since only the suggestion is changed, but I have no data to back that up.

An alternative and much more disruptive solution might be to use a specific exception such as UnknownBuildTargetError(target), and move printing the suggestion to a layer higher up where it could figure out the proper hint. This is probably a big overkill though.

I was looking at other tools, that might be affected by this. Only rhpkg overrides mock-config, but it just adds extra data to the generated config.
--target is relevant only for mock-config, which is called separately as "standalone".
Other cases rely on --release and AFAIK can't change the target in any other way.

:thumbsup:

Pull-Request has been merged by onosek

Metadata