Skip to content

Command-line parsing: warn about seemingly invalid variations arguments.

This follows-on from a Reproducible Builds (rb-general) mailing list discussion.

In particular, it emits a warning in situations where the command-line indicates removal of a variant when none were previously configured.

# Valid cases: these continue to parse without warning:

--variations=all,-timezone                          # add 'all' items explicitly, remove one
--variations=kernel --vary=timezone --vary=-kernel  # add two items and remove one of them
--vary=-build_path                                  # remove from implicit default 'all' items
--vary=timezone --vary=-timezone                    # add an item and then remove it 


# Warning cases: these now emit a warning and suggestion:

--variations=-timezone                             # removing item from empty set
# Detected a --variations argument that attempts to remove variations from an empty specification.
# Did you mean: '--variations=+all,-timezone'?

Edit: apply correction to second valid example case.

Edited by James Addison

Merge request reports

Loading