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 schangesfile_basename="${schangesfile##*/}"
63 packagenameversion="${schangesfile_basename%_*}"
65 case "$schangesfile" in
66 */*) cd "${schangesfile%/*}";;
69 dcmd cp "${schangesfile##*/}" "$BUILDDIR"
70 schangesfile="$schangesfile_basename"
74 sbuild $sbuild_args --arch="$arch" --arch-all --dist="$dist" --keyid=$KEYID \
75 "$packagenameversion".dsc
77 changesfile="${packagenameversion}_${arch}.changes"
79 dinstall "$dist" "$schangesfile"
80 dinstall "$dist" "$changesfile"
82 mv "$changesfile" "${changesfile}.binonly"
83 mergechanges "$schangesfile" "${changesfile}.binonly" > "$changesfile"
84 rm "${changesfile}.binonly" "$schangesfile"
86 DATESTR="$(date +%Y.%m.%d.%H%M%S)"
87 BUILD_PREFIX="${packagenameversion}_${arch}.${DATESTR}"
89 mv current "${BUILD_PREFIX}".buildlog
92 bundle="${BUNDLE_DIR}/${BUILD_PREFIX}".bundle.tar
98 echo "Bundle available at $bundle ."