ipxe-1.0.0_p20130925-git-version.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 6153c09c41034250408f3596555fcaae715da46c Mon Sep 17 00:00:00 2001
  2. From: Florian Schmaus <flo@geekplace.eu>
  3. Date: Mon, 28 Jul 2014 16:47:48 +0100
  4. Subject: [PATCH] [build] Set GITVERSION only if there is a git repository
  5. The $(BIN)/version.%.o target will fail if iPXE is built within a
  6. non-git repository, e.g. when the user downloaded and extracted an
  7. archive containing iPXE sources, *and* if any parent directory of the
  8. iPXE sources is a git repository (or even contains a directory named
  9. ".git"). This is because git will by default ascend the directory
  10. tree and look for ".git".
  11. The problem typically manifests on source based distributions, see for
  12. example https://bugs.gentoo.org/show_bug.cgi?id=482804
  13. Modified-by: Michael Brown <mcb30@ipxe.org>
  14. Signed-off-by: Michael Brown <mcb30@ipxe.org>
  15. ---
  16. src/Makefile | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. diff --git a/src/Makefile b/src/Makefile
  19. index 22a7335..c6760ee 100644
  20. --- a/src/Makefile
  21. +++ b/src/Makefile
  22. @@ -190,8 +190,8 @@ VERSION_PATCH = 0
  23. EXTRAVERSION = +
  24. MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
  25. VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
  26. +ifneq ($(wildcard ../.git),)
  27. GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
  28. -ifneq ($(GITVERSION),)
  29. VERSION += ($(GITVERSION))
  30. endif
  31. version :
  32. --
  33. 2.3.2