* mk-schroot: add debootstrap include/exclude options

* mk-schroot.1: document added options
This commit is contained in:
Steve Beattie 2010-07-27 23:07:34 -07:00
parent 1e7993df3e
commit a5c97797d3
3 changed files with 42 additions and 3 deletions

6
debian/changelog vendored
View File

@ -20,7 +20,11 @@ ubuntu-dev-tools (0.101) UNRELEASED; urgency=low
* requestsync: Fix bug where the variable 'hasLP' is not always set
(lp: #607874).
-- Michael Bienia <geser@ubuntu.com> Tue, 20 Jul 2010 19:44:18 +0200
[ Steve Beattie ]
* mk-schroot: add debootstrap include/exclude options
* mk-schroot.1: document added options
-- Steve Beattie <sbeattie@ubuntu.com> Tue, 27 Jul 2010 16:02:52 -0700
ubuntu-dev-tools (0.100) maverick; urgency=low

View File

@ -37,6 +37,15 @@ Use FILE as the sources.list template (defaults to $HOME/.mk\-sbuild.sources).
Use URL as the debootstrap source (defaults to http://ports.ubuntu.com for lpia,
official Ubuntu repositories for the supported architectures).
.TP
.B \-\-debootstrap\-include=alpha,beta
Pass along a comma separated list of packages to debootstrap's --include
argument. See debootstrap (8) for more details.
.TP
.B \-\-debootstrap\-exclude=alpha,beta
Pass along a comma separated list of packages to debootstrap's --exclude
argument. WARNING: be careful using this option as you can end up
excluding essential package. See debootstrap (8) for more details.
.TP
.B \-\-distro=DISTRO
Enable distro-specific logic. Currently known distros: "ubuntu" (default)
and "debian".
@ -66,6 +75,12 @@ Do not include the \-updates pocket in the installed sources.list.
.B DEBOOTSTRAP_MIRROR
Mirror location (same as \-\-debootstrap-mirror)
.TP
.B DEBOOTSTRAP_INCLUDE
Comma separated list of packages to include when bootstrapping (same as \-\-debootstrap-include)
.TP
.B DEBOOTSTRAP_EXCLUDE
Comma separated list of packages to exclude when bootstrapping (same as \-\-debootstrap-exclude; see warning above)
.TP
.B SOURCE_CHROOTS_DIR
use SOURCE_CHROOTS_DIR as home of schroot source directories. (default
/var/lib/schroot/chroots)

View File

@ -112,6 +112,8 @@ function usage()
echo " --skip-updates Do not include -updates pocket in sources.list"
echo " --source-template=FILE Use FILE as the sources.list template"
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
echo " --debootstrap-include=list Comma separated list of packages to include"
echo " --debootstrap-exclude=list Comma separated list of packages to exclude"
echo " --distro=DISTRO Install specific distro:"
echo " 'ubuntu'(default), or 'debian'"
echo " --type=SCHROOT_TYPE Define the schroot type:"
@ -126,6 +128,8 @@ function usage()
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
echo " SKIP_UPDATES Enable --skip-updates"
echo " DEBOOTSTRAP_MIRROR Mirror location (same as --debootstrap-mirror)"
echo " DEBOOTSTRAP_INCLUDE Included packages (same as --debootstrap-include)"
echo " DEBOOTSTRAP_EXCLUDE Excluded packages (same as --debootstrap-exclude)"
echo " TEMPLATE_SOURCES A template for sources.list"
echo " TEMPLATE_SCHROOTCONF A template for schroot.conf stanza"
exit 1
@ -135,7 +139,7 @@ function usage()
if [ -z "$1" ]; then
usage
fi
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,personality:,distro:,vg:,type:" -- "$@"`
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,debootstrap-include:,debootstrap-exclude:,personality:,distro:,vg:,type:" -- "$@"`
eval set -- "$OPTS"
VG=""
@ -179,6 +183,14 @@ while :; do
DEBOOTSTRAP_MIRROR="$2"
shift 2
;;
--debootstrap-include)
DEBOOTSTRAP_INCLUDE="$2"
shift 2
;;
--debootstrap-exclude)
DEBOOTSTRAP_EXCLUDE="$2"
shift 2
;;
--distro)
DISTRO="$2"
shift 2
@ -362,6 +374,14 @@ debian)
;;
esac
if [ -n "$DEBOOTSTRAP_INCLUDE" ] ; then
debootstrap_opts="--include=$DEBOOTSTRAP_INCLUDE"
fi
if [ -n "$DEBOOTSTRAP_EXCLUDE" ] ; then
debootstrap_opts="$debootstrap_opts --exclude=$DEBOOTSTRAP_EXCLUDE"
fi
DEBOOTSTRAP_COMMAND=debootstrap
# Use qemu-kvm-extras-static for foreign chroots
if [ "$CHROOT_ARCH" != "$HOST_ARCH" ] ; then
@ -402,7 +422,7 @@ case "$SCHROOT_TYPE" in
esac
# debootstrap the chroot
sudo "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
sudo "$DEBOOTSTRAP_COMMAND" --arch="$CHROOT_ARCH" $variant_opt $debootstrap_opts "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}"
# Update the package sources
TEMP_SOURCES=`mktemp -t sources-XXXXXX`