[commit: ghc] master: Improve VERSION/GIT_COMMIT_ID handling for sdist (7dd4c12)

git at git.haskell.org git at git.haskell.org
Fri Nov 28 10:03:32 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7dd4c12c608ba7b42e6e453f4db825655716f01d/ghc

>---------------------------------------------------------------

commit 7dd4c12c608ba7b42e6e453f4db825655716f01d
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Nov 28 10:57:18 2014 +0100

    Improve VERSION/GIT_COMMIT_ID handling for sdist
    
    This makes `VERSION` updating a bit more robust (the file gets only
    updated if its content would actually change), as well as moving the
    dependency of `VERSION` and `GIT_COMMIT_ID` to the `sdist-ghc-prep`
    target, as that's where it's actually needed.
    
    This fixes the specialised target `make sdist-ghc` not properly
    creating/updating the `VERSION` and `GIT_COMMIT_ID` files before
    creating the ghc source-dist tarball, as well as avoiding stale
    `VERSION` files.


>---------------------------------------------------------------

7dd4c12c608ba7b42e6e453f4db825655716f01d
 ghc.mk | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ghc.mk b/ghc.mk
index c47104d..2c9c635 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1112,8 +1112,11 @@ SRC_DIST_GHC_FILES += \
     settings.in VERSION GIT_COMMIT_ID \
     boot packages ghc.mk
 
-VERSION :
-	echo $(ProjectVersion) >VERSION
+.PHONY: VERSION
+VERSION:
+	@if test -f $@ && test "`cat $@`" = "$(ProjectVersion)"; \
+	then echo "$@ needs no update"; \
+	else echo "update $@ ($(ProjectVersion))"; echo "$(ProjectVersion)" > $@; fi
 
 .PHONY: GIT_COMMIT_ID
 GIT_COMMIT_ID:
@@ -1129,7 +1132,7 @@ GIT_COMMIT_ID:
 	then echo "$@ needs no update"; \
 	else echo "update $@ ($(ProjectGitCommitId))"; echo -n "$(ProjectGitCommitId)" > $@; fi
 
-sdist : VERSION GIT_COMMIT_ID
+sdist-ghc-prep : VERSION GIT_COMMIT_ID
 
 # Use:
 #     $(call sdist_ghc_file,compiler,stage2,cmm,Foo/Bar,CmmLex,x)



More information about the ghc-commits mailing list