diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-09 03:30:23 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-09 21:51:02 -0400 |
commit | e0473e207b299858ef9550ed71be125a9db994ac (patch) | |
tree | c465423f60a66fe739b52a713dea700e86e926d5 /tools/pre-commit | |
parent | 6154b9e794942bae557516a358e1bc3d665b60db (diff) | |
download | fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.tar.gz fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.tar.bz2 fork-ledger-e0473e207b299858ef9550ed71be125a9db994ac.zip |
Rewrote acprep in Python and improved the build
Diffstat (limited to 'tools/pre-commit')
-rwxr-xr-x | tools/pre-commit | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/tools/pre-commit b/tools/pre-commit index b04b895c..b3bc2e2b 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -1,30 +1,18 @@ #!/bin/sh -"$(tg --hooks-path)"/pre-commit "$@" || exit $? +# Exit with status 1 if any command below fails +set -e +# Exit if it's not a branch we're interested in being thorough about if echo $(git rev-parse --symbolic-full-name HEAD) | grep -q ^refs/heads/t/; then exit 0 fi -if [ $(git rev-parse --symbolic-full-name HEAD) = refs/heads/test ]; then - exit 0 -fi # These are the locations I keep my temporary source and build trees in -OUTPUT=$(tools/outdir) # generates a build directory name such as +PRODUCTS=$(./acprep products) # generates a build directory name such as # ~/Products/ledger -PRODUCTS=$(dirname "$OUTPUT") -BASE=$(basename "$OUTPUT") - -if [ -z "$BASE" ]; then - TMPDIR=$PWD/pre-commit - MIRROR=$PWD/pre-commit-mirror -else - TMPDIR=$PRODUCTS/$BASE-pre-commit - MIRROR=$PRODUCTS/$BASE-pre-commit-mirror -fi - -# Exit with status 1 if any command below fails -set -e +TMPDIR=$PRODUCTS/pre-commit +MIRROR=$PRODUCTS/pre-commit-mirror # Checkout a copy of the current index into MIRROR git checkout-index --prefix=$MIRROR/ -af @@ -50,12 +38,14 @@ cd $TMPDIR # regenerate everything manually. If the user doesn't have acprep, look # for other common autoconf-related script files. if [ ! -f Makefile -o \ - Makefile.am -nt Makefile -o \ - configure.ac -nt Makefile -o \ + Makefile.in -nt Makefile -o \ + configure -nt Makefile -o \ + Makefile.am -nt Makefile.in -o \ + configure.ac -nt configure -o \ \( -f acprep -a acprep -nt Makefile \) ] then if [ -f acprep ]; then - ./acprep --local --warn --pch + ./acprep default --local elif [ -f autogen.sh ]; then sh autogen.sh && ./configure else |