Skip to content

Commit

Permalink
Update auto_firmware_version.py
Browse files Browse the repository at this point in the history
Removed upstream release info from git hash
  • Loading branch information
OFreddy committed Mar 23, 2024
1 parent 62a97d5 commit 8c9b8a9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pio-scripts/auto_firmware_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,22 @@ def get_firmware_specifier_build_flag():
build_version = porcelain.describe('.') # '.' refers to the repository root dir
except:
build_version = "g0000000"

print ("###########################################")
print ("Firmware Revision retuned from git: " + build_version)

# filter out release tag from build info git describe --tags
gitindex = build_version.find("-g")
if gitindex >= 0:
print ("contains build info at index %i" % gitindex)
build_version = build_version[gitindex+1:]
print ("filtered git hash: " + build_version)

print ("###########################################")

build_flag = "-D AUTO_GIT_HASH=\\\"" + build_version + "\\\""
print ("Firmware Revision: " + build_version)
return (build_flag)

env.Append(
BUILD_FLAGS=[get_firmware_specifier_build_flag()]
)
)

0 comments on commit 8c9b8a9

Please sign in to comment.