[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#826361: debootstrap: please allow the packages to be installed to be customizable via enviroment variables



Package: debootstrap
Version: 1.0.81
Severity: wishlist
Tags: patch

This patch, suitable for application via "git am", will be used as part
of the xfstests-bld infrastructure.  (See http://thunk.org/gce-xfstests
for more info).  I'll be using a modified copy of this script for now,
but it would be nice if in the future I don't have to copy and hack
/usr/share/debootstrap/scripts/sid.

Thanks!!

						- Ted

>From 3386b48cd06863a37dd60188c164c41e7cadd6e0 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Sat, 4 Jun 2016 18:29:27 -0400
Subject: [PATCH] Allow the package list to be customized via environment
 variables

Over half of the supported variants (minbase, fakechroot, build) are
there to allow the caller of debootstrap to customize the packages to
be installed in the constructed system.  Furthermore, the only way to
add a new variant is to copy and then edit the deboostrap SCRIPT,
which is not a very maintainable way to interact with the debootstrap
infrastructure as new distributions are released which may require
modifications to the script.

So allow the caller of debootstrap to control which packages will be
used in the creation of the bootstrapped system via the environment
variables DEBOOTSTRAP_BASE_PKGS and DEBOOTSTRAP_ADD_PKGS.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 scripts/sid | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/sid b/scripts/sid
index 7b32ac2..43bce57 100644
--- a/scripts/sid
+++ b/scripts/sid
@@ -18,7 +18,9 @@ esac
 work_out_debs () {
 	required="$(get_debs Priority: required)"
 
-	if doing_variant - || doing_variant fakechroot; then
+	if test -n "$DEBOOTSTRAP_BASE_PKGS" ; then
+		base=$DEBOOTSTRAP_BASE_PKGS
+	elif doing_variant - || doing_variant fakechroot; then
 		#required="$required $(get_debs Priority: important)"
 		#  ^^ should be getting debconf here somehow maybe
 		base="$(get_debs Priority: important)"
@@ -27,6 +29,9 @@ work_out_debs () {
 	elif doing_variant minbase; then
 		base="apt"
 	fi
+	if test -n "$DEBOOTSTRAP_ADD_PKGS" ; then
+		base="$base $DEBOOTSTRAP_ADD_PKGS"
+	fi
 
 	if doing_variant fakechroot; then
 		# ldd.fake needs binutils
-- 
2.5.0



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (650, 'testing'), (600, 'unstable'), (500, 'testing-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-rc6-00235-gb61e5b0 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages debootstrap depends on:
ii  wget  1.17.1-2

Versions of packages debootstrap recommends:
ii  debian-archive-keyring  2014.3
ii  gnupg                   1.4.20-6

debootstrap suggests no packages.

-- no debconf information


Reply to: