6 echo "usage: dcp-build [-Nh] REPODIR OUTDIR"
19 while [ "${1:0:1}" = - ]; do
22 if [ "$opt" = N ]; then
25 elif [ "$opt" = h ]; then
29 echo "dcp-build: unknown option '$opt'" >&2
42 if [[ "$repodir" != */* ]]; then
43 repodir="$defdir/${repodir}.git"
46 if [ ! -d "$repodir" ]; then
47 echo "dcp-build: could not find $repodir" >&2
50 if [ ! -d "$outdir" ]; then
51 echo "dcp-build: could not find $outdir" >&2
55 td="$(mktemp -d /tmp/dcp-XXXXXX)"
56 exec >"$td/log" 2>"$td/err"
57 dcp-runenv "$repodir" "$td"
59 rungit tag -f lastbuild
60 (cd "$td"; control/build) || false
61 cp -a "$td/output"/* "$outdir/"
63 if [ "$push" = y ]; then rungit push --tags; fi