mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-07-18 02:11:28 +00:00
Determine distribution from release name (via distro-info).
This commit is contained in:
parent
ebe04d88b0
commit
7218468e18
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -4,6 +4,7 @@ ubuntu-dev-tools (0.123) UNRELEASED; urgency=low
|
|||||||
- Disable daemons with a policy-rc.d script (like pbuilder does)
|
- Disable daemons with a policy-rc.d script (like pbuilder does)
|
||||||
- Move package installation after option parsing.
|
- Move package installation after option parsing.
|
||||||
- Exit 0 when showing help, and support -h.
|
- Exit 0 when showing help, and support -h.
|
||||||
|
- Determine distribution from release name (via distro-info).
|
||||||
|
|
||||||
-- Stefano Rivera <stefanor@debian.org> Sun, 24 Apr 2011 12:45:31 +0200
|
-- Stefano Rivera <stefanor@debian.org> Sun, 24 Apr 2011 12:45:31 +0200
|
||||||
|
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
mk\-sbuild \- creates chroots via schroot and sbuild
|
mk\-sbuild \- creates chroots via schroot and sbuild
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fBmk\-sbuild\fR [\fB\-\-arch=ARCH\fR] [\fB\-\-name=NAME\fR]
|
\fBmk\-sbuild\fR [\fIoptions\fR...] <\fIrelease\fR>
|
||||||
[\fB\-\-personality=PERSONALITY\fR] [\fB\-\-debug\fR] [\fB\-\-source\-template=FILE\fR]
|
|
||||||
[\fB\-\-debootstrap\-mirror=URL\fR] [\fB\-\-distro=DISTRO\fR]
|
|
||||||
[\fB\-\-vg=VOLUME_GROUP\fR] [\fB\-\-type=SCHROOT_TYPE\fR] <\fBRelease\fR>
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBmk\-sbuild\fR creates chroots via schroot and sbuild.
|
\fBmk\-sbuild\fR creates chroots via schroot and sbuild.
|
||||||
@ -47,8 +44,9 @@ argument. WARNING: be careful using this option as you can end up
|
|||||||
excluding essential package. See debootstrap (8) for more details.
|
excluding essential package. See debootstrap (8) for more details.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-distro=DISTRO
|
.B \-\-distro=DISTRO
|
||||||
Enable distro-specific logic. Currently known distros: "ubuntu" (default)
|
Enable distro-specific logic.
|
||||||
and "debian".
|
When not provided, the distribution is determined from \fIrelease\fR.
|
||||||
|
Currently known distros: "\fBdebian\fR" and "\fBubuntu\fR".
|
||||||
.TP
|
.TP
|
||||||
.B \-\-vg=VOLUME_GROUP
|
.B \-\-vg=VOLUME_GROUP
|
||||||
Specify a volume group, and subsequently use a default SCHROOT_TYPE of
|
Specify a volume group, and subsequently use a default SCHROOT_TYPE of
|
||||||
|
21
mk-sbuild
21
mk-sbuild
@ -5,6 +5,7 @@
|
|||||||
# Kees Cook <kees@ubuntu.com>
|
# Kees Cook <kees@ubuntu.com>
|
||||||
# Emmet Hikory <persia@ubuntu.com>
|
# Emmet Hikory <persia@ubuntu.com>
|
||||||
# Scott Moser <smoser@ubuntu.com>
|
# Scott Moser <smoser@ubuntu.com>
|
||||||
|
# Stefano Rivera <stefanor@ubuntu.com>
|
||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
#
|
#
|
||||||
@ -52,7 +53,8 @@ function usage()
|
|||||||
echo " --debootstrap-include=list Comma separated list of packages to include"
|
echo " --debootstrap-include=list Comma separated list of packages to include"
|
||||||
echo " --debootstrap-exclude=list Comma separated list of packages to exclude"
|
echo " --debootstrap-exclude=list Comma separated list of packages to exclude"
|
||||||
echo " --distro=DISTRO Install specific distro:"
|
echo " --distro=DISTRO Install specific distro:"
|
||||||
echo " 'ubuntu'(default), or 'debian'"
|
echo " 'ubuntu' or 'debian' "
|
||||||
|
echo " (defaults to determining from release name)"
|
||||||
echo " --type=SCHROOT_TYPE Define the schroot type:"
|
echo " --type=SCHROOT_TYPE Define the schroot type:"
|
||||||
echo " 'directory'(default), 'file', or 'btrfs-snapshot'"
|
echo " 'directory'(default), 'file', or 'btrfs-snapshot'"
|
||||||
echo " 'lvm-snapshot' is selected via --vg"
|
echo " 'lvm-snapshot' is selected via --vg"
|
||||||
@ -84,7 +86,7 @@ OPTS=`getopt -o 'h' --long "help,debug,skip-updates,arch:,name:,source-template:
|
|||||||
eval set -- "$OPTS"
|
eval set -- "$OPTS"
|
||||||
|
|
||||||
VG=""
|
VG=""
|
||||||
DISTRO="ubuntu"
|
DISTRO=""
|
||||||
name=""
|
name=""
|
||||||
while :; do
|
while :; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -224,6 +226,21 @@ if [ -z "$RELEASE" ]; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Determine distribution
|
||||||
|
if [ -z "$DISTRO" ]; then
|
||||||
|
if debian-distro-info --all | grep -Fqx "$RELEASE"; then
|
||||||
|
DISTRO=debian
|
||||||
|
elif ubuntu-distro-info --all | grep -Fqx "$RELEASE"; then
|
||||||
|
DISTRO=ubuntu
|
||||||
|
elif [ "$RELEASE" = "unstable" -o "$RELEASE" = "testing" \
|
||||||
|
-o "$RELEASE" = "stable" -o "$RELEASE" = "oldstable" ]; then
|
||||||
|
DISTRO=debian
|
||||||
|
else
|
||||||
|
echo "Unable to determine distribution, please provide --distro" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# By default, name the schroot the same as the release
|
# By default, name the schroot the same as the release
|
||||||
if [ -z "$name" ]; then
|
if [ -z "$name" ]; then
|
||||||
name="$RELEASE"
|
name="$RELEASE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user