0001-fixed-don-t-generate-an-invalid-env.h-when-not-built.patch 1000 B

12345678910111213141516171819202122232425262728293031
  1. From 369ffb5be23eca520df99732541d0482da271fd3 Mon Sep 17 00:00:00 2001
  2. From: Lars Op den Kamp <lars@opdenkamp.eu>
  3. Date: Sat, 11 Jul 2015 00:53:17 +0200
  4. Subject: [PATCH] fixed: don't generate an invalid env.h when not built with
  5. the .git dir present. closes #112
  6. Backported from upstream commit 2f32a9debc1f148b5dfcfc463480f1432bb71725.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. ---
  9. support/git-rev.sh | 7 +++++--
  10. 1 file changed, 5 insertions(+), 2 deletions(-)
  11. diff --git a/support/git-rev.sh b/support/git-rev.sh
  12. index 5dce3d0..4aadae6 100755
  13. --- a/support/git-rev.sh
  14. +++ b/support/git-rev.sh
  15. @@ -1,5 +1,8 @@
  16. #!/bin/sh
  17. ## cmake doesn't read the variable when it doesn't end with a newline, and I haven't figured out how to have it add a newline directly...
  18. -echo -n "`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h"`\n"
  19. -
  20. +if [ -d .git ]; then
  21. + echo "`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h"`"
  22. +else
  23. + echo "<unknown>"
  24. +fi
  25. --
  26. 2.5.0