Skip to content
Snippets Groups Projects

tools: bootstrap: fix version checking algorithm

Open Khalid Masum requested to merge Labnann/vlc:fix-version-check-tool into master
2 unresolved threads
If major number is not equal for needmajor and gotmajor, the version
checker returns old, which can lead to faulty results.

For example:
check_version meson 1.0.0 0.6.0 returns old; where expected is ok.

Fix this issue by changing the check of ne to gt. So that it returns
old if needmajor is greater than gotmajor.



Testcases:
==========
After change:
-------------
MyApp got:1.0.0 need:0.6.0 | actual: ok expected: ok
MyApp got:1.0.0 need:1.0.0 | actual: ok expected: ok
MyApp got:2.0.0 need:1.0.0 | actual: ok expected: ok
MyApp got:1.1.0 need:1.0.0 | actual: ok expected: ok
MyApp got:1.0.1 need:1.0.0 | actual: ok expected: ok
MyApp got:1.0.0 need:2.0.0 | actual: old expected: old
MyApp got:1.0.0 need:1.1.0 | actual: old expected: old
MyApp got:1.0.0 need:1.0.1 | actual: old expected: old
MyApp got:0.9.9 need:1.0.0 | actual: old expected: old
MyApp got:1.9.9 need:2.0.0 | actual: old expected: old
MyApp got:1.2.3 need:1.3.0 | actual: old expected: old
MyApp got:2.0.5 need:2.1.0 | actual: old expected: old



Before change
-------------
MyApp got:1.0.0 need:0.6.0 | actual: old expected: ok <-- error
MyApp got:1.0.0 need:1.0.0 | actual: ok expected: ok
MyApp got:2.0.0 need:1.0.0 | actual: old expected: ok <-- error
MyApp got:1.1.0 need:1.0.0 | actual: ok expected: ok
MyApp got:1.0.1 need:1.0.0 | actual: ok expected: ok
MyApp got:1.0.0 need:2.0.0 | actual: old expected: old
MyApp got:1.0.0 need:1.1.0 | actual: old expected: old
MyApp got:1.0.0 need:1.0.1 | actual: old expected: old
MyApp got:0.9.9 need:1.0.0 | actual: old expected: old
MyApp got:1.9.9 need:2.0.0 | actual: old expected: old
MyApp got:1.2.3 need:1.3.0 | actual: old expected: old
MyApp got:2.0.5 need:2.1.0 | actual: old expected: old
Edited by Khalid Masum

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #328409 passed

Merge request pipeline passed for 0cb6a0a4

Approval is optional
The target branch master does not exist. Please restore it or use a different target branch.

Merge details

  • The source branch is 10662 commits behind the target branch.
  • 2 commits will be added to master.
  • Source branch will be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading