Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 4,161
    • Issues 4,161
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Merge requests
  • !7427

file(ARCHIVE*): Simplify acceptance of empty list arguments

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Brad King requested to merge brad.king/cmake:file-archive-args into master Jun 29, 2022
  • Overview 5
  • Commits 2
  • Pipelines 1
  • Changes 8

In cmArgumentParser, a keyword bound to a std::vector<std::string> value is reported in the list of keywords with missing values if the keyword appears followed by an empty list. For cases where we want to tolerate empty lists, clients need to filter out such keywords themselves before producing an error message. This may be improved in the future, but that is out of scope here.

In !4475 (merged), a pattern for filtering out keywords that accept empty lists was copied from !4262 (merged) incorrectly in two ways:

  • Keywords were included in the filter that do not accept empty lists.
  • Keywords were not in sorted order, breaking the filter operation.

Those two bugs mostly canceled each other out, and the resulting behavior was to correctly report keywords with missing values. However, the MTIME keyword was accidentally accepted with no value by pretending the keyword was not given at all.

Simplify the logic by removing keywords from the filters that should not be there. Leave MTIME in the filter for compatibility.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: file-archive-args