Improve bootloader version parsing from GIT_VERSION#374
Improve bootloader version parsing from GIT_VERSION#374piotrmalek wants to merge 2 commits intoadafruit:masterfrom
Conversation
|
hmm, I don't know if we need this, since we consistently release this with 1.2.3 format |
|
Thanks! Totally fair - if tags are always strictly 1.2.3, the old logic usually works. |
# Conflicts: # Makefile
| # 1.2.3 | ||
| # 1.2.3-147-gd71abcd | ||
| # If the version string does not match MAJOR.MINOR.PATCH, defaults to 0.0.0. | ||
| _VER3 := $(shell echo "$(GIT_VERSION)" | sed -E 's/^v?([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 \2 \3/; t; s/.*/0 0 0/') |
There was a problem hiding this comment.
I resolved the conflict with master, my question would be whether using sed -E portable, i.e if this work on windows command prompt ? If this isn't the isssue, I think we can merge this right away.
Description of Change
This PR improves the parsing of GIT_VERSION in the Makefile when generating
the bootloader version value.
The previous logic assumed a strict MAJOR.MINOR.PATCH format and could produce
incorrect results for common Git tag formats such as:
The new implementation extracts semantic version components more robustly
and safely defaults to 0.0.0 if the version string does not match the expected
format.
This change does not affect existing version formats and is backward compatible.