53 lines
1.3 KiB
Bash
Executable file
53 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
ledger_proof() {
|
|
SRC="$1"
|
|
DEST="$2"
|
|
LOGDIR="$3"
|
|
|
|
cd "$SRC"
|
|
VERSION=$(git describe --all --long)
|
|
|
|
if [[ -f $DEST/last-proofed && $(< $DEST/last-proofed) = $VERSION ]]; then
|
|
echo "No need to run tools/proof again"
|
|
exit 0
|
|
fi
|
|
|
|
rm -fr $DEST/ledger-proof
|
|
|
|
time nice -n 20 \
|
|
./acprep --enable-doxygen --universal --python --clang -j16 proof 2>&1 | \
|
|
tee $LOGDIR/ledger-proof.log
|
|
|
|
if egrep -q '(ERROR|CRITICAL)' $LOGDIR/ledger-proof.log; then
|
|
cat <<EOF | mutt -a $LOGDIR/ledger-proof.log \
|
|
-s '[ledger] Proof build FAILED' johnw@newartisans.com
|
|
Ledger proof build FAILED, at commit $VERSION.
|
|
EOF
|
|
|
|
if [[ "$1" = "--alert" ]]; then
|
|
notify "Ledger proof build FAILED"
|
|
else
|
|
echo "Ledger proof build FAILED"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo $VERSION > $DEST/last-proofed
|
|
|
|
cd $DEST/ledger-proof/debug; make docs
|
|
cd $DEST/ledger-proof/gcov; make report
|
|
|
|
cat <<EOF | mutt -a $LOGDIR/ledger-proof.log \
|
|
-s '[ledger] Proof build succeeded' johnw@newartisans.com
|
|
Ledger proof build succeeded! at commit $VERSION.
|
|
EOF
|
|
echo "Ledger proof build succeeded"
|
|
fi
|
|
}
|
|
|
|
ledger_proof ${1:-$HOME/src/ledger} \
|
|
${2:-$HOME/Products} ${3:-$HOME/Library/Logs}
|
|
|
|
exit 0
|