All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 # mbuild - automate builds with sbuild and dinstall the result
5 # Copyright (c) 2008 martin f. krafft <madduck@debian.org>
6 # Released under the terms of the Artistic Licence 2.0.
10 BUILDDIR="$(mktemp -dt mbuild.XXXXXXXX)"
11 trap "cd / && rm -R '$BUILDDIR'" 0
13 BUNDLE_DIR="${TMPDIR:-/tmp}"
15 echo "Would install into $1:"
16 for file in $(dcmd echo "$2"); do
23 MBUILDRCS="/etc/mbuild/rc $HOME/.mbuildrc $HOME/.mbuild/rc"
24 for rc in $MBUILDRCS; do
25 [ -r "$rc" ] && . "$rc"
28 if [ -z "$KEYID" ]; then
29 echo "E: \$KEYID is not defined in rc file." >&2
39 --arch=*) arch="${opt#--arch=}";;
40 --dist=*) dist="${opt#--dist=}";;
41 -sa) sbuild_args="${sbuild_args:+$sbuild_args }--force-orig-source";;
42 --*) sbuild_args="${sbuild_args:+$sbuild_args }$opt";;
44 if [ -z "$schangesfile" ]; then
45 if [ -f "$opt" ] && [ -r "$opt" ]; then
48 echo "E: file does not exist: $opt" >&2
52 echo "E: cannot pass more than one source changes file: $opt" >&2
57 echo "E: unknown option: $opt" >&1
63 schangesfile_basename="${schangesfile##*/}"
64 packagenameversion="${schangesfile_basename%_*}"
66 case "$schangesfile" in
67 */*) cd "${schangesfile%/*}";;
70 dcmd cp "${schangesfile##*/}" "$BUILDDIR"
71 schangesfile="$schangesfile_basename"
75 sbuild $sbuild_args --arch="$arch" --arch-all --dist="$dist" --keyid=$KEYID \
76 "$packagenameversion".dsc
78 changesfile="${packagenameversion}_${arch}.changes"
80 dinstall "$dist" "$schangesfile"
81 dinstall "$dist" "$changesfile"
83 mv "$changesfile" "${changesfile}.binonly"
84 mergechanges "$schangesfile" "${changesfile}.binonly" > "$changesfile"
85 rm "${changesfile}.binonly" "$schangesfile"
87 DATESTR="$(date +%Y.%m.%d.%H%M%S)"
88 BUILD_PREFIX="${packagenameversion}_${arch}.${DATESTR}"
90 mv current "${BUILD_PREFIX}".buildlog
93 bundle="${BUNDLE_DIR}/${BUILD_PREFIX}".bundle.tar"
99 echo "Bundle available at $bundle ."