Commit a726385
committed
iot2050-firmware-update: Improve min_version calculation in backup
Refactor the firmware update script to more robustly calculate the
`min_version` during the backup process.
The previous implementation was brittle, as it incorrectly assumed the
version prefix was always a single character. This caused failures with
version strings that did not have a prefix (e.g., "1.6.2").
This change introduces a new `_get_min_version` helper method that uses
a regular expression to parse the version string. It correctly
identifies numeric components and replaces any number greater than 1
with a '1', while preserving the original zero-padding.
The logic now first isolates the main version tag (the portion before
any hyphen) and then passes it to the new helper method to ensure a
correct and reliable `min_version` is generated for the backup
configuration.
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>1 parent efe7030 commit a726385
File tree
1 file changed
+18
-3
lines changed- meta-example/recipes-app/iot2050-firmware-update/files
1 file changed
+18
-3
lines changedLines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
492 | 507 | | |
493 | 508 | | |
494 | 509 | | |
| |||
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
| 539 | + | |
524 | 540 | | |
525 | 541 | | |
526 | | - | |
527 | | - | |
| 542 | + | |
528 | 543 | | |
529 | 544 | | |
530 | 545 | | |
| |||
0 commit comments