diff options
-rwxr-xr-x | check-repo | 21 | ||||
-rwxr-xr-x | renew-config | 5 |
2 files changed, 22 insertions, 4 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 $? diff --git a/renew-config b/renew-config index e9aea35..db7cef2 100755 --- a/renew-config +++ b/renew-config @@ -18,10 +18,7 @@ if [ -n "$(git rev-list HEAD..FETCH_HEAD)" ]; then error "$REPO: HEAD does not equal to origin/master." fi -# update symlinks (needed for repo validation) -$BINDIR/prepare-repository - -if ! bcfg2-lint -Q "$REPO"; then +if ! $BINDIR/check-repo; then error "$REPO: bcfg2-lint detected errors." fi |