summaryrefslogtreecommitdiffstats
path: root/check-repo
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-02-07 16:53:30 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2015-02-07 16:53:30 +0100
commitfc019f7f036e45c14ca0dc05d8882cb9ec1c2c8b (patch)
tree98d7baea592973cfa6de0d98a9eae7a7bf0146f6 /check-repo
parentcbed530b48e49d1c3a90fb7946733a2a63286270 (diff)
downloadbcfg2-tools-fc019f7f036e45c14ca0dc05d8882cb9ec1c2c8b.tar.gz
bcfg2-tools-fc019f7f036e45c14ca0dc05d8882cb9ec1c2c8b.tar.bz2
bcfg2-tools-fc019f7f036e45c14ca0dc05d8882cb9ec1c2c8b.zip
check-repo: Add script for repo validation.
This script could be used in the commit hook and in the renew-config script.
Diffstat (limited to 'check-repo')
-rwxr-xr-xcheck-repo21
1 files changed, 21 insertions, 0 deletions
diff --git a/check-repo b/check-repo
new file mode 100755
index 0000000..2cdf7bb
--- /dev/null
+++ b/check-repo
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. settings.sh
+
+DIR="$(mktemp -d)"
+trap 'rm -rf "${DIR}"' EXIT INT TERM HUP
+
+echo "Running checks..."
+
+cd "$REPO"
+if [ "$1" = "index" ]; then
+ git checkout-index -a --prefix="$DIR/"
+else
+ git archive "${1:-HEAD}" | tar -x -C "$DIR/"
+fi
+
+prepare-repository "$DIR"
+mkdir "$DIR/SSHbase/" "$DIR/etc/" "$DIR/.git"
+
+bcfg2-lint -Q "${DIR}"
+exit $?