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}"
16 echo "Copying files destined for $1 back to $TARGET_DIR..."
17 dcmd cp -v "$2" "$TARGET_DIR"
22 MBUILDRCS="/etc/mbuild/rc $HOME/.mbuildrc $HOME/.mbuild/rc"
23 for rc in $MBUILDRCS; do
24 [ -r "$rc" ] && . "$rc"
27 if [ -z "$KEYID" ]; then
28 echo "E: \$KEYID is not defined in rc file." >&2
38 --arch=*) arch="${opt#--arch=}";;
39 --dist=*) dist="${opt#--dist=}";;
40 -sa) sbuild_args="${sbuild_args:+$sbuild_args }--force-orig-source";;
41 --*) sbuild_args="${sbuild_args:+$sbuild_args }$opt";;
43 if [ -z "$schangesfile" ]; then
44 if [ -f "$opt" ] && [ -r "$opt" ]; then
47 echo "E: file does not exist: $opt" >&2
51 echo "E: cannot pass more than one source changes file: $opt" >&2
56 echo "E: unknown option: $opt" >&1
62 [ -z "$arch" ] && arch="$(dpkg-architecture -qDEB_BUILD_ARCH)"
63 [ -z "$dist" ] && dist="sid"
65 schangesfile_basename="${schangesfile##*/}"
66 packagenameversion="${schangesfile_basename%_*}"
68 case "$schangesfile" in
69 */*) cd "${schangesfile%/*}";;
72 dcmd cp "${schangesfile##*/}" "$BUILDDIR"
73 schangesfile="$schangesfile_basename"
77 sbuild $sbuild_args --arch="$arch" --arch-all --dist="$dist" --keyid=$KEYID \
78 "$packagenameversion".dsc
80 changesfile="${packagenameversion}_${arch}.changes"
82 dinstall "$dist" "$schangesfile"
83 dinstall "$dist" "$changesfile"
85 mv "$changesfile" "${changesfile}.binonly"
86 mergechanges "$schangesfile" "${changesfile}.binonly" > "$changesfile"
87 rm "${changesfile}.binonly" "$schangesfile"
89 DATESTR="$(date +%Y.%m.%d.%H%M%S)"
90 BUILD_PREFIX="${packagenameversion}_${arch}.${DATESTR}"
92 mv current "${BUILD_PREFIX}".buildlog
95 bundle="${BUNDLE_DIR}/${BUILD_PREFIX}".bundle.tar
101 echo "Bundle available at $bundle ."