Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

extract_git_sha1 630B

1234567891011121314151617181920
  1. #!/bin/sh
  2. if [ ! -f src/mesa/main/git_sha1.h ]; then
  3. touch src/mesa/main/git_sha1.h
  4. fi
  5. if [ ! -d .git ]; then
  6. exit
  7. fi
  8. if which git > /dev/null; then
  9. # Extract the 7-digit "short" SHA1 for the current HEAD, convert
  10. # it to a string, and wrap it in a #define. This is used in
  11. # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
  12. git log -n 1 --oneline |\
  13. sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
  14. > src/mesa/main/git_sha1.h.tmp
  15. if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
  16. mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
  17. fi
  18. fi