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="$BUILDDIR"
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
41 --arch=*) arch="${opt#--arch=}";;
42 --dist=*) dist="${opt#--dist=}";;
43 -sa) sbuild_args="${sbuild_args:+$sbuild_args }--force-orig-source";;
44 --*) sbuild_args="${sbuild_args:+$sbuild_args }$opt";;
46 if [ -z "$schangesfile" ]; then
47 if [ -f "$opt" ] && [ -r "$opt" ]; then
50 echo "E: file does not exist: $opt" >&2
54 echo "E: cannot pass more than one source changes file: $opt" >&2
59 echo "E: unknown option: $opt" >&1
65 schangesfile_basename="${schangesfile##*/}"
66 packagenameversion="${schangesfile_basename%_*}"
68 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 bundle="$BUNDLEDIR/${packagenameversion}.bundle.tar"
87 dcmd tar -cvhf "$bundle" "$changesfile"
92 echo "Bundle available at $bundle ."