Files
OpenCellular/util/getversion.sh
Vadim Bendebury 38650d0b5d util: move 'dirty' marker to be a prefix, not a suffix
With longer git SHA1s reported by git commands and longer version
strings, the entire SHA1 could be not fitting into the 32 byte version
of the VERSION string. So, instead of adding the 'dirty' marker to the
end of SHA1 let's replace the prefix dash with it in case the tree is
dirty.

This way the length of the version string does not change (as long as
the 'dirty' marker is one character long).

BRANCH=cr50
BUG=b:64698702
TEST=verified output of running getversion.sh with a clean tree

   $ ./util/getversion.sh  | grep VERSION32
   #define CROS_EC_VERSION32 "_v1.1.7046-591608e2e"

  and a 'dirty' tree

   $ ./util/getversion.sh  | grep VERSION32
   #define CROS_EC_VERSION32 "_v1.1.7046+591608e2e"

Change-Id: I42684522beaff9e9714206cfaddaf97e6cd644be
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/665958
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-15 08:46:32 -07:00

4.0 KiB
Executable File