← Back to team overview

mythbuntu-dev team mailing list archive

lp:~sbeattie/ubuntu-dev-tools/mk-schroot-debootstrap_include_exclude into lp:ubuntu-dev-tools

 

Steve Beattie has proposed merging lp:~sbeattie/ubuntu-dev-tools/mk-schroot-debootstrap_include_exclude into lp:ubuntu-dev-tools.

Requested reviews:
  Ubuntu Development Team (ubuntu-dev)


This merge proposal adds support to mk-schroot to pass along --include/--exclude arguments to debootstrap, along with corresponding config variable support. It's useful for adding additional packages automatically to schroots at setup time; e.g. the ubuntu-security's build wrappers invoke debuild from the devscripts package in the schroot, but devscripts is not included in the default install by debootstrap.

(I could see not including the exclusion option, but I added it for symmetry.)
-- 
https://code.launchpad.net/~sbeattie/ubuntu-dev-tools/mk-schroot-debootstrap_include_exclude/+merge/31118
Your team Ubuntu Development Team is requested to review the proposed merge of lp:~sbeattie/ubuntu-dev-tools/mk-schroot-debootstrap_include_exclude into lp:ubuntu-dev-tools.
=== modified file 'debian/changelog'
--- debian/changelog	2010-07-20 17:47:45 +0000
+++ debian/changelog	2010-07-28 06:20:56 +0000
@@ -20,7 +20,11 @@
   * requestsync: Fix bug where the variable 'hasLP' is not always set
     (lp: #607874).
 
- -- Michael Bienia <geser@xxxxxxxxxx>  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@xxxxxxxxxx>  Tue, 27 Jul 2010 16:02:52 -0700
 
 ubuntu-dev-tools (0.100) maverick; urgency=low
 

=== modified file 'doc/mk-sbuild.1'
--- doc/mk-sbuild.1	2010-04-11 08:31:49 +0000
+++ doc/mk-sbuild.1	2010-07-28 06:20:56 +0000
@@ -37,6 +37,15 @@
 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 @@
 .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)

=== modified file 'mk-sbuild'
--- mk-sbuild	2010-06-17 18:56:59 +0000
+++ mk-sbuild	2010-07-28 06:20:56 +0000
@@ -112,6 +112,8 @@
     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 @@
     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 @@
 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 @@
             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 @@
     ;;
 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 @@
 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`