aboutsummaryrefslogtreecommitdiff
path: root/reproduce
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce')
-rw-r--r--reproduce/src/bash/git-post-checkout9
-rw-r--r--reproduce/src/bash/git-pre-commit11
2 files changed, 15 insertions, 5 deletions
diff --git a/reproduce/src/bash/git-post-checkout b/reproduce/src/bash/git-post-checkout
index e2a0fd0..153b277 100644
--- a/reproduce/src/bash/git-post-checkout
+++ b/reproduce/src/bash/git-post-checkout
@@ -9,8 +9,13 @@
# special characters for the installation location of meta-store so our own
# installation is found by Git.
-# File containig the metadata.
+# File containig the metadata and metastore executable.
MSFILE=".file-metadata"
+MSBIN=@BINDIR@/metastore
+
+# If metastore is not installed, then ignore this script (exit with a
+# status of 0).
+if [ ! -f $MSBIN ]; then exit 0; fi
# Delete all temporary files
find @TOP_PROJECT_DIR@/ -name "*~" -type f -delete
@@ -32,7 +37,7 @@ fi
# Run metastore.
exit_on_fail \
- @BINDIR@/metastore -a -m -e -E -q -O @USER@ -G @GROUP@ -f "$MSFILE"
+ $MSBIN -a -m -e -E -q -O @USER@ -G @GROUP@ -f "$MSFILE"
# Return with a success code (0).
exit 0
diff --git a/reproduce/src/bash/git-pre-commit b/reproduce/src/bash/git-pre-commit
index ca28757..0fa6c52 100644
--- a/reproduce/src/bash/git-pre-commit
+++ b/reproduce/src/bash/git-pre-commit
@@ -20,8 +20,13 @@
# git reset HEAD -- .metadata
# git checkout HEAD -- .metadata
-# File containig the metadata.
+# File containig the metadata and metastore executable.
MSFILE=".file-metadata"
+MSBIN=@BINDIR@/metastore
+
+# If metastore is not installed, then ignore this script (exit with a
+# status of 0).
+if [ ! -f $MSBIN ]; then exit 0; fi
# Function to help in reporting a crash.
exit_on_fail() {
@@ -34,12 +39,12 @@ exit_on_fail() {
# Run metastore.
exit_on_fail \
- @BINDIR@/metastore -O @USER@ -G @GROUP@ -s -f "$MSFILE"
+ $MSBIN -O @USER@ -G @GROUP@ -s -f "$MSFILE"
# If it's first metastore commit, store again to include $MSFILE in $MSFILE.
if ! git-ls-tree --name-only HEAD 2>/dev/null | grep -Fqx "$MSFILE"; then
exit_on_fail \
- @BINDIR@/metastore -O @USER@ -G @GROUP@ -s -f "$MSFILE"
+ $MSBIN -O @USER@ -G @GROUP@ -s -f "$MSFILE"
fi
# Check if the metadata file exists.