aboutsummaryrefslogtreecommitdiff
path: root/reproduce
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce')
-rw-r--r--reproduce/analysis/make/initialize.mk6
-rw-r--r--reproduce/software/make/basic.mk31
2 files changed, 23 insertions, 14 deletions
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk
index ee9c8c1..918ae06 100644
--- a/reproduce/analysis/make/initialize.mk
+++ b/reproduce/analysis/make/initialize.mk
@@ -181,7 +181,8 @@ $(lockdir): | $(BDIR); mkdir $@
# we want to ensure that the file is always built in every run: it contains
# the project version which may change between two separate runs, even when
# no file actually differs.
-packagebasename := $(shell echo paper-$$(git describe --dirty --always --long))
+packagebasename := $(shell if [ -d .git ]; then \
+ echo paper-$$(git describe --dirty --always --long); else echo NOGIT; fi)
packagecontents = $(texdir)/$(packagebasename)
.PHONY: all clean dist dist-zip distclean clean-mmap $(packagecontents) \
$(mtexdir)/initialize.tex
@@ -342,5 +343,6 @@ dist-zip: $(packagecontents)
$(mtexdir)/initialize.tex: | $(mtexdir)
# Version of the project.
- @v=$$(git describe --dirty --always --long);
+ @if [ -d .git ]; then v=$$(git describe --dirty --always --long);
+ else v=NO-GIT; fi
echo "\newcommand{\projectversion}{$$v}" > $@
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index 17ff561..b0b757f 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -968,6 +968,11 @@ $(ibidir)/metastore: $(tdir)/metastore-$(metastore-version).tar.gz \
#
# We want to inform the user if Metastore isn't built, so we don't
# continue the call to `gbuild' with an `&&'.
+ #
+ # Checking for presence of `.git'. When the project source is
+ # downloaded from a non-Git source (for example from arXiv), there
+ # is no `.git' directory to work with. So until we find a better
+ # solution, avoid the step to to add the Git hooks.
current_dir=$$(pwd); \
$(call gbuild, $<, metastore-$(metastore-version), static,, \
NO_XATTR=1 V=1,,pwd,PREFIX=$(idir)); \
@@ -975,18 +980,20 @@ $(ibidir)/metastore: $(tdir)/metastore-$(metastore-version).tar.gz \
if [ "x$(needpatchelf)" != x ]; then \
$(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/metastore; \
fi; \
- user=$$(whoami); \
- group=$$(groups | awk '{print $$1}'); \
- cd $$current_dir; \
- for f in pre-commit post-checkout; do \
- sed -e's|@USER[@]|'$$user'|g' \
- -e's|@GROUP[@]|'$$group'|g' \
- -e's|@BINDIR[@]|$(ibdir)|g' \
- -e's|@TOP_PROJECT_DIR[@]|'$$current_dir'|g' \
- reproduce/software/bash/git-$$f > .git/hooks/$$f \
- && chmod +x .git/hooks/$$f \
- && echo "Metastore (forked) $(metastore-version)" > $@; \
- done; \
+ if [ -d .git ]; then \
+ user=$$(whoami); \
+ group=$$(groups | awk '{print $$1}'); \
+ cd $$current_dir; \
+ for f in pre-commit post-checkout; do \
+ sed -e's|@USER[@]|'$$user'|g' \
+ -e's|@GROUP[@]|'$$group'|g' \
+ -e's|@BINDIR[@]|$(ibdir)|g' \
+ -e's|@TOP_PROJECT_DIR[@]|'$$current_dir'|g' \
+ reproduce/software/bash/git-$$f > .git/hooks/$$f \
+ && chmod +x .git/hooks/$$f; \
+ done; \
+ fi \
+ && echo "Metastore (forked) $(metastore-version)" > $@; \
else \
echo; echo; echo; \
echo "*****************"; \