mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-06-05 21:11:37 +00:00
* mk-sbuild-lv:
- Fully handle missing build log directories (LP: #342154). - More generalized approach to Distro-specific logic (LP: #342158).
This commit is contained in:
parent
cadae8c549
commit
58cc975f12
12
debian/changelog
vendored
12
debian/changelog
vendored
@ -7,17 +7,21 @@ ubuntu-dev-tools (0.72) UNRELEASED; urgency=low
|
|||||||
[ Siegfried-Angel Gevatter Pujals ]
|
[ Siegfried-Angel Gevatter Pujals ]
|
||||||
* pbuilder-dist:
|
* pbuilder-dist:
|
||||||
- Add squeeze as a Debian distribution. Thanks to Marco Rodrigues.
|
- Add squeeze as a Debian distribution. Thanks to Marco Rodrigues.
|
||||||
|
|
||||||
[ Nathan Handler ]
|
[ Nathan Handler ]
|
||||||
* pull-debian-source:
|
* pull-debian-source:
|
||||||
- Add support for etch/oldstable
|
- Add support for etch/oldstable
|
||||||
- Make script work for codenames (etch, lenny, squeeze, sid)
|
- Make script work for codenames (etch, lenny, squeeze, sid)
|
||||||
|
|
||||||
[ Ryan Kavanagh ]
|
[ Ryan Kavanagh ]
|
||||||
* Fixed mk-sbuild-lv (s/DEBOOTSTRAP_MIRRORS/DEBOOTSTRAP_MIRROR/).
|
|
||||||
* Ported devscripts' build-rdeps to Ubuntu and replaced
|
* Ported devscripts' build-rdeps to Ubuntu and replaced
|
||||||
reverse-build-depends. Updated it's manpage. (LP: #272273)
|
reverse-build-depends. Updated it's manpage. (LP: #272273)
|
||||||
|
|
||||||
|
[ Kees Cook ]
|
||||||
|
* mk-sbuild-lv:
|
||||||
|
- Fully handle missing build log directories (LP: #342154).
|
||||||
|
- More generalized approach to Distro-specific logic (LP: #342158).
|
||||||
|
|
||||||
-- Nathan Handler <nhandler@ubuntu.com> Sat, 28 Mar 2009 15:19:26 +0100
|
-- Nathan Handler <nhandler@ubuntu.com> Sat, 28 Mar 2009 15:19:26 +0100
|
||||||
|
|
||||||
ubuntu-dev-tools (0.71) jaunty; urgency=low
|
ubuntu-dev-tools (0.71) jaunty; urgency=low
|
||||||
|
@ -36,8 +36,9 @@ Use FILE as the sources.list template (defaults to $HOME/.mk\-sbuild\-lv.sources
|
|||||||
Use URL as the debootstrap source (defaults to http://ports.ubuntu.com for lpia,
|
Use URL as the debootstrap source (defaults to http://ports.ubuntu.com for lpia,
|
||||||
official Ubuntu repositories for the supported architectures).
|
official Ubuntu repositories for the supported architectures).
|
||||||
.TP
|
.TP
|
||||||
.B \-\-debian
|
.B \-\-distro
|
||||||
Make a Debian schroot environment.
|
Enable distro-specific logic. Currently known distros: "ubuntu" (default)
|
||||||
|
and "debian".
|
||||||
|
|
||||||
.SH ENVIRONMENT VARIABLES
|
.SH ENVIRONMENT VARIABLES
|
||||||
.TP
|
.TP
|
||||||
|
95
mk-sbuild-lv
95
mk-sbuild-lv
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2006-2007 (C) Canonical Ltd.
|
# Copyright 2006-2009 (C) Canonical Ltd.
|
||||||
# Created by Kees Cook <kees@ubuntu.com>
|
# Author: Kees Cook <kees@ubuntu.com>
|
||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
#
|
#
|
||||||
@ -9,7 +9,7 @@
|
|||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 3
|
# as published by the Free Software Foundation; either version 3
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
@ -23,19 +23,7 @@
|
|||||||
# Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto,
|
# Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto,
|
||||||
# and https://help.ubuntu.com/community/SbuildLVMHowto.
|
# and https://help.ubuntu.com/community/SbuildLVMHowto.
|
||||||
#
|
#
|
||||||
# It assumes that sbuild has not be installed and configured before.
|
# It will deal with sbuild having not be installed and configured before.
|
||||||
#
|
|
||||||
# If using schroot earlier than 1.1.4-1, it's a good idea to apply the
|
|
||||||
# process-cleaning patch to /etc/schroot/setup.d/10mount. Without this, any
|
|
||||||
# processes left running from the build (like cron, dbus, etc) will stop
|
|
||||||
# schroot from umounting and shutting down cleanly:
|
|
||||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391319
|
|
||||||
#
|
|
||||||
# If using sbuild 0.50 or earlier, and you intend to use the "arch" argument
|
|
||||||
# to do i386 builds on amd64, you will need to patch "sbuild" to correctly
|
|
||||||
# detect the chroot architecture:
|
|
||||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392992
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Make sure we've got a regular user
|
# Make sure we've got a regular user
|
||||||
@ -116,12 +104,15 @@ function usage()
|
|||||||
echo " --skip-updates Do not include -updates pocket in sources.list"
|
echo " --skip-updates Do not include -updates pocket in sources.list"
|
||||||
echo " --source-template=FILE Use FILE as the sources.list template"
|
echo " --source-template=FILE Use FILE as the sources.list template"
|
||||||
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
|
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
|
||||||
|
echo " --distro=DISTRO Install specific distro (defaults to 'ubuntu')"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Configuration (via ~/.mk-sbuild-lv.rc)"
|
echo "Configuration (via ~/.mk-sbuild-lv.rc)"
|
||||||
echo " LV_SIZE Size of source LVs (default ${LV_SIZE})"
|
echo " LV_SIZE Size of source LVs (default ${LV_SIZE})"
|
||||||
echo " SNAPSHOT_SIZE Size of snapshot LVs (default ${SNAPSHOT_SIZE})"
|
echo " SNAPSHOT_SIZE Size of snapshot LVs (default ${SNAPSHOT_SIZE})"
|
||||||
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
|
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
|
||||||
echo " SKIP_UPDATES Enable --skip-updates"
|
echo " SKIP_UPDATES Enable --skip-updates"
|
||||||
|
echo " TEMPLATE_SOURCES A template for sources.list"
|
||||||
|
echo " TEMPLATE_SCHROOTCONF A template for schroot.conf stanza"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,9 +120,10 @@ function usage()
|
|||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,personality:" -- "$@"`
|
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,personality:,distro:" -- "$@"`
|
||||||
eval set -- "$OPTS"
|
eval set -- "$OPTS"
|
||||||
|
|
||||||
|
DISTRO="ubuntu"
|
||||||
name=""
|
name=""
|
||||||
while :; do
|
while :; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -173,6 +165,10 @@ while :; do
|
|||||||
DEBOOTSTRAP_MIRROR="$2"
|
DEBOOTSTRAP_MIRROR="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
--distro)
|
||||||
|
DISTRO="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
@ -206,12 +202,6 @@ if [ -r ~/.mk-sbuild-lv.rc ]; then
|
|||||||
. ~/.mk-sbuild-lv.rc
|
. ~/.mk-sbuild-lv.rc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Settings check.
|
|
||||||
if [ $DEBIAN ] && [ ! -x /usr/bin/cdebootstrap ]; then
|
|
||||||
echo "Please install the cdebootstrap package to create a Debian schroot."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Does the specified VG exist? (vgdisplay doesn't set error codes...)
|
# Does the specified VG exist? (vgdisplay doesn't set error codes...)
|
||||||
if [ `sudo vgdisplay -c "$VG" | wc -l` -eq 0 ]; then
|
if [ `sudo vgdisplay -c "$VG" | wc -l` -eq 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
@ -225,10 +215,47 @@ else
|
|||||||
variant_opt="--variant=buildd"
|
variant_opt="--variant=buildd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# are we doing an lpia build?
|
# Handle distro-specific logic, unknown to debootstrap
|
||||||
if [ -z "$DEBOOTSTRAP_MIRROR" ] && [ "$arch_opt" = "--arch lpia" ]; then
|
case "$DISTRO" in
|
||||||
DEBOOTSTRAP_MIRROR="http://ports.ubuntu.com/"
|
ubuntu)
|
||||||
fi
|
# are we doing an lpia build?
|
||||||
|
if [ -z "$DEBOOTSTRAP_MIRROR" ] && [ "$arch_opt" = "--arch lpia" ]; then
|
||||||
|
DEBOOTSTRAP_MIRROR="http://ports.ubuntu.com/"
|
||||||
|
fi
|
||||||
|
if [ -z "$DEBOOTSTRAP_MIRROR" ]; then
|
||||||
|
DEBOOTSTRAP_MIRROR="http://archive.ubuntu.com/ubuntu"
|
||||||
|
fi
|
||||||
|
if [ -z "$COMPONENTS" ]; then
|
||||||
|
COMPONENTS="main restricted universe multiverse"
|
||||||
|
fi
|
||||||
|
if [ -z "$SOURCES_SECURITY_SUITE" ]; then
|
||||||
|
SOURCES_SECURITY_SUITE="RELEASE-updates"
|
||||||
|
fi
|
||||||
|
if [ -z "$SOURCES_SECURITY_URL" ]; then
|
||||||
|
SOURCES_SECURITY_URL="http://security.ubuntu.com/ubuntu"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
debian)
|
||||||
|
if [ -z "$DEBOOTSTRAP_MIRROR" ]; then
|
||||||
|
DEBOOTSTRAP_MIRROR="http://ftp.debian.org/debian"
|
||||||
|
fi
|
||||||
|
if [ -z "$COMPONENTS" ]; then
|
||||||
|
COMPONENTS="main non-free contrib"
|
||||||
|
fi
|
||||||
|
# Debian only performs security updates
|
||||||
|
SKIP_UPDATES=1
|
||||||
|
if [ -z "$SOURCES_SECURITY_SUITE" ]; then
|
||||||
|
SOURCES_SECURITY_SUITE="RELEASE/updates"
|
||||||
|
fi
|
||||||
|
if [ -z "$SOURCES_SECURITY_URL" ]; then
|
||||||
|
SOURCES_SECURITY_URL="http://security.debian.org/"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown --distro '$DISTRO': aborting" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Allocate the "golden" chroot LV
|
# Allocate the "golden" chroot LV
|
||||||
sudo lvcreate -n "$CHROOT_LV" -L "$LV_SIZE" "$VG"
|
sudo lvcreate -n "$CHROOT_LV" -L "$LV_SIZE" "$VG"
|
||||||
@ -247,18 +274,18 @@ if [ -r "$TEMPLATE_SOURCES" ]; then
|
|||||||
cat "$TEMPLATE_SOURCES" > "$TEMP_SOURCES"
|
cat "$TEMPLATE_SOURCES" > "$TEMP_SOURCES"
|
||||||
else
|
else
|
||||||
cat > "$TEMP_SOURCES" <<EOM
|
cat > "$TEMP_SOURCES" <<EOM
|
||||||
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
deb ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS}
|
||||||
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
deb-src ${DEBOOTSTRAP_MIRROR} RELEASE ${COMPONENTS}
|
||||||
EOM
|
EOM
|
||||||
if [ -z "$SKIP_UPDATES" ]; then
|
if [ -z "$SKIP_UPDATES" ]; then
|
||||||
cat >> "$TEMP_SOURCES" <<EOM
|
cat >> "$TEMP_SOURCES" <<EOM
|
||||||
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
deb ${DEBOOTSTRAP_MIRROR} RELEASE-updates ${COMPONENTS}
|
||||||
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
deb-src ${DEBOOTSTRAP_MIRROR} RELEASE-updates ${COMPONENTS}
|
||||||
EOM
|
EOM
|
||||||
fi
|
fi
|
||||||
cat >> "$TEMP_SOURCES" <<EOM
|
cat >> "$TEMP_SOURCES" <<EOM
|
||||||
deb http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
deb ${SOURCES_SECURITY_URL} ${SOURCES_SECURITY_SUITE} ${COMPONENTS}
|
||||||
deb-src http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
deb-src ${SOURCES_SECURITY_URL} ${SOURCES_SECURITY_SUITE} ${COMPONENTS}
|
||||||
EOM
|
EOM
|
||||||
fi
|
fi
|
||||||
cat "$TEMP_SOURCES" | sed -e "s|RELEASE|$RELEASE|g" | \
|
cat "$TEMP_SOURCES" | sed -e "s|RELEASE|$RELEASE|g" | \
|
||||||
@ -317,7 +344,7 @@ set -e
|
|||||||
# Reload package lists
|
# Reload package lists
|
||||||
apt-get update || true
|
apt-get update || true
|
||||||
# Pull down signature requirements
|
# Pull down signature requirements
|
||||||
apt-get -y --force-yes install gnupg ubuntu-keyring
|
apt-get -y --force-yes install gnupg ${DISTRO}-keyring
|
||||||
# Reload package lists
|
# Reload package lists
|
||||||
apt-get update || true
|
apt-get update || true
|
||||||
# Disable debconf questions so that automated builds won't prompt
|
# Disable debconf questions so that automated builds won't prompt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user