diff --git a/features.in/build-distro/lib/90-build-distro.mk b/features.in/build-distro/lib/90-build-distro.mk index ffebfadc..76c0192a 100644 --- a/features.in/build-distro/lib/90-build-distro.mk +++ b/features.in/build-distro/lib/90-build-distro.mk @@ -40,8 +40,4 @@ dot-disk: fi @echo "$(ARCH)" >files/.disk/arch @echo "$(DATE)" >files/.disk/date - @if type -t git >&/dev/null; then \ - ( cd $(TOPDIR) && test -d .git && \ - git show-ref --head -ds -- HEAD ||:) \ - >files/.disk/commit 2>/dev/null; \ - fi + @if [ -s commit ]; then cp commit files/.disk/; fi diff --git a/lib/profile.mk b/lib/profile.mk index 35460e8c..1177ceea 100644 --- a/lib/profile.mk +++ b/lib/profile.mk @@ -71,6 +71,9 @@ profile/init: distclean [ "$(CHECK)" = 0 ] || exit 1; \ fi; \ fi; \ + if type -t git >&/dev/null && [ -d .git ]; then \ + git show -s --format=%H > "$(BUILDDIR)"/commit; \ + fi; \ mp-commit -i "$(BUILDDIR)" "derivative profile initialized"; \ if [ -w . ]; then \ rm -f "$(SYMLINK)" && \