1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/usr/bin/env bash
set -euo pipefail
top="$(pwd -P)"
usage() { echo 'Usage: update-checkout-info DEST'; }
if test "$#" -ne 1; then
usage 1>&2; exit 1
fi
dest="$1"
if ! test -f lib/bup/bupsplit.c; then
echo 'error: cannot find bup source tree' 1>&2
exit 1
fi
if ! test -e .git; then
# Not building from a git tree
rm -f "$dest"
exit 0
fi
local_changes=$(git status --porcelain -uno)
(git log -1 --pretty="commit='%H'%ndate='%ci'"
echo -n 'modified='
if test "$local_changes"; then echo True; else echo False; fi) \
| dev/refresh -v -- "$dest"
|