Browse Source

waf: use GIT_VERSION from env if available

This allows for reproducible builds to be produced
gps-1.3.1
Peter Barker 3 years ago committed by Andrew Tridgell
parent
commit
43b4f86485
  1. 2
      Tools/ardupilotwaf/chibios.py

2
Tools/ardupilotwaf/chibios.py

@ -205,7 +205,7 @@ class set_app_descriptor(Task.Task): @@ -205,7 +205,7 @@ class set_app_descriptor(Task.Task):
desc_len = 16
crc1 = to_unsigned(crc32(bytearray(img[:offset])))
crc2 = to_unsigned(crc32(bytearray(img[offset+desc_len:])))
githash = to_unsigned(int('0x' + self.generator.bld.git_head_hash(short=True),16))
githash = to_unsigned(int('0x' + os.environ.get('GIT_VERSION', self.generator.bld.git_head_hash(short=True)),16))
desc = struct.pack('<IIII', crc1, crc2, len(img), githash)
img = img[:offset] + desc + img[offset+desc_len:]
Logs.info("Applying %s APP_DESCRIPTOR %08x%08x" % (self.env.APP_DESCRIPTOR, crc1, crc2))

Loading…
Cancel
Save