6 echo "usage: dcp-update [-Nh] REPODIR"
19 while [ "${1:0:1}" = - ]; do
22 if [ "$opt" = N ]; then
24 elif [ "$opt" = h ]; then
28 echo "dcp-update: unknown option '$opt'" >&2
40 if [[ "$repodir" != */* ]]; then
41 repodir="$defdir/${repodir}.git"
44 if [ ! -d "$repodir" ]; then
45 echo "dcp-build: could not find $repodir" >&2
49 td="$(mktemp -d /tmp/dcp-XXXXXX)"
50 exec >"$td/log" 2>"$td/err"
51 dcp-runenv "$repodir" "$td"
53 lastrev="$(rungit rev-parse HEAD)"
54 (cd "$td"; control/update) || false
55 rungit checkout master
56 newrev="$(rungit rev-parse HEAD)"
58 echo "update: $lastrev -> $newrev"
60 if [ "$push" = y ]; then rungit push; fi