summaryrefslogtreecommitdiffstats
path: root/debootstrap
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@debian.org>2009-07-22 15:09:27 (GMT)
committerOtavio Salvador <otavio@debian.org>2009-07-22 15:09:27 (GMT)
commitcc2786d9dadf108f067554ed908307611e954859 (patch)
tree2cbed6ade3413b62478cc211d701eee6a44c6861 /debootstrap
parent1a5b695b4e2334cbd6746b200aa78e863a591e54 (diff)
downloaddebootstrap-cc2786d9dadf108f067554ed908307611e954859.zip
debootstrap-cc2786d9dadf108f067554ed908307611e954859.tar.gz
debootstrap-cc2786d9dadf108f067554ed908307611e954859.tar.bz2
Apply patch from Riku Voipio <riku.voipio@iki.fi> to add support for scratchbox variant. Closes: #536820.
r59598
Diffstat (limited to '')
-rwxr-xr-xdebootstrap21
-rw-r--r--debootstrap.84
2 files changed, 22 insertions, 3 deletions
diff --git a/debootstrap b/debootstrap
index dfe3f8b..ac821b8 100755
--- a/debootstrap
+++ b/debootstrap
@@ -79,7 +79,8 @@ usage()
--components=A,B,C use packages from the listed components of the
archive
--variant=X use variant X of the bootstrap scripts
- (currently supported variants: buildd, fakechroot)
+ (currently supported variants: buildd, fakechroot,
+ scratchbox)
--keyring=K check Release files against keyring K
--no-resolve-deps don't try to resolve dependencies automatically
@@ -346,7 +347,23 @@ else
error 1 WHATARCH "Couldn't work out current architecture"
fi
-export ARCH SUITE TARGET
+if [ "$TARGET" = "/" ]; then
+ CHROOT_CMD=""
+elif doing_variant scratchbox; then
+ for config in ~/.scratchbox2/*/sb2.config;
+ do
+ export `grep ^SBOX_TARGET_ROOT= $config`
+ if [ "x$SBOX_TARGET_ROOT" = "x$TARGET" ]; then
+ SB2_TARGET=$(basename $(dirname $config))
+ fi
+ done
+ [ "x$SB2_TARGET" != "x" ] || error 1 SBOXTARGETREQ "No scratchbox target configured for $TARGET"
+ CHROOT_CMD="sb2 -eR -t $SB2_TARGET"
+else
+ CHROOT_CMD="chroot $TARGET"
+fi
+
+export ARCH SUITE TARGET CHROOT_CMD
if am_doing_phase first_stage second_stage; then
if [ -x /usr/bin/id ] && [ `id -u` -ne 0 ]; then
diff --git a/debootstrap.8 b/debootstrap.8
index 81a5855..c1995cc 100644
--- a/debootstrap.8
+++ b/debootstrap.8
@@ -70,13 +70,15 @@ or apt, and that it is far better to specify the entire base system than
rely on this option.
With this option set, this behaviour is disabled.
.IP
-.IP "\fB\-\-variant=minbase|buildd|fakechroot\fP"
+.IP "\fB\-\-variant=minbase|buildd|fakechroot|scratchbox\fP"
Name of the bootstrap script variant to use.
Currently, the variants supported are minbase, which only includes
essential packages and apt; buildd, which installs the build-essential
packages into
.IR TARGET ;
and fakechroot, which installs the packages without root privileges.
+Finally there is variant scratchbox, which is for creating targets
+for scratchbox usage.
The default, with no \fB\-\-variant=X\fP argument, is to create a base
Debian installation in
.IR TARGET .