diff --git a/VERSION b/VERSION index 320e1686b2ba..97086204559f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.075.0 +v2.074.1 diff --git a/src/ddmd/globals.d b/src/ddmd/globals.d index 2921b0638094..b0b3a1fe0ac3 100644 --- a/src/ddmd/globals.d +++ b/src/ddmd/globals.d @@ -335,7 +335,7 @@ struct Global } copyright = "Copyright (c) 1999-2017 by Digital Mars"; written = "written by Walter Bright"; - _version = ('v' ~ import("VERSION") ~ '\0').ptr; + _version = (import("VERSION") ~ '\0').ptr; compiler.vendor = "Digital Mars D"; stdmsg = stdout; main_d = "__main.d"; diff --git a/src/posix.mak b/src/posix.mak index 803db4df0ef8..bc300f3daddc 100644 --- a/src/posix.mak +++ b/src/posix.mak @@ -466,25 +466,20 @@ $G/idgen: $D/idgen.d $(HOST_DMD_PATH) CC=$(HOST_CXX) $(HOST_DMD_RUN) -of$@ $< $G/idgen -######### -# STRING_IMPORT_FILES -# -# Create (or update) the generated VERSION file. -# The file is only updated if the VERSION file changes, or, only when RELEASE=1 -# is not used, when the full version string changes (i.e. when the git hash or -# the working tree dirty states changes). -# The full version string have the form VERSION-devel-HASH(-dirty). -# The "-dirty" part is only present when the repository had uncommitted changes -# at the moment it was compiled (only files already tracked by git are taken -# into account, untracked files don't affect the dirty state). -VERSION := $(shell cat ../VERSION) -ifneq (1,$(RELEASE)) -VERSION_GIT := $(shell printf "`$(GIT) rev-parse --short HEAD`"; \ - test -n "`$(GIT) status --porcelain -uno`" && printf -- -dirty) -VERSION := $(addsuffix -devel$(if $(VERSION_GIT),-$(VERSION_GIT)),$(VERSION)) +######## VERSION + +VERSION := $(shell cat ../VERSION) # default to checked-in VERSION file +ifneq (1,$(RELEASE)) # unless building a release + VERSION_GIT := $(shell printf "`$(GIT) describe --dirty`") # use git describe + ifneq (,$(VERSION_GIT)) # check for git failures + VERSION := $(VERSION_GIT) + endif endif + +# only update $G/VERSION when it differs to avoid unnecessary rebuilds $(shell test $(VERSION) != "`cat $G/VERSION 2> /dev/null`" \ && printf $(VERSION) > $G/VERSION ) + $(shell test $(SYSCONFDIR) != "`cat $G/SYSCONFDIR.imp 2> /dev/null`" \ && printf '$(SYSCONFDIR)' > $G/SYSCONFDIR.imp )