]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(Makefile): use of potentially unset variable
authorConrad Hoffmann <ch@bitfehler.net>
Thu, 2 Jun 2022 08:31:50 +0000 (10:31 +0200)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Thu, 2 Jun 2022 12:25:44 +0000 (12:25 +0000)
`CWD` is not a Make variable. This may have worked accidentally for some
people if their shell happend to provide `CWD` and Make picked it up.

As is, this tends to pick up git versions of unrelated parent
directories, e.g. when packaging for distributions.

Makefile

index ab47fed86041d5b8d87d8e218626a39b6d042516..97e189b4641d341783c2dafc8552e9ce08edc8ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
 -include dracut-version.sh
 
-DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
+DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
 ifeq ($(DRACUT_MAIN_VERSION),)
 DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
 endif
-DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
+DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :)
 ifeq ($(DRACUT_FULL_VERSION),)
 DRACUT_FULL_VERSION = $(DRACUT_VERSION)
 endif