diff --git a/debian/changelog b/debian/changelog index 90cd16f..a0e05f2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ubuntu-dev-tools (0.123) UNRELEASED; urgency=low - * mk-sbuild: Disable daemons with a policy-rc.d script (like pbuilder does) + * mk-sbuild: + - Disable daemons with a policy-rc.d script (like pbuilder does) + - Move package installation after option parsing. -- Stefano Rivera Sun, 24 Apr 2011 12:45:31 +0200 diff --git a/mk-sbuild b/mk-sbuild index 35ad22c..f8714ac 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -30,70 +30,6 @@ # It will deal with sbuild having not be installed and configured before. set -e -# For when schroot enters the chroot, we cannot be in a directory that -# will not exist in the chroot. -cd / - -# Make sure we've got a regular user -if [ -w /etc/passwd ]; then - echo "Please run this script as a regular user, not root." >&2 - exit 1 -fi - -# Perform once-only things to initially set up for using sbuild+schroot -if [ ! -w /var/lib/sbuild ]; then - # Load all the packages you'll need to do work - sudo apt-get install sbuild schroot debootstrap - # Add self to the sbuild group - sudo adduser "$USER" sbuild - - # Prepare a usable default .sbuildrc - if [ ! -e ~/.sbuildrc ]; then - cat > ~/.sbuildrc <&2 - exit 1 -fi - # Set up configurable defaults (loaded after option processing) LV_SIZE="5G" SNAPSHOT_SIZE="4G" @@ -215,6 +151,70 @@ while :; do esac done +# For when schroot enters the chroot, we cannot be in a directory that +# will not exist in the chroot. +cd / + +# Make sure we've got a regular user +if [ -w /etc/passwd ]; then + echo "Please run this script as a regular user, not root." >&2 + exit 1 +fi + +# Perform once-only things to initially set up for using sbuild+schroot +if [ ! -w /var/lib/sbuild ]; then + # Load all the packages you'll need to do work + sudo apt-get install sbuild schroot debootstrap + # Add self to the sbuild group + sudo adduser "$USER" sbuild + + # Prepare a usable default .sbuildrc + if [ ! -e ~/.sbuildrc ]; then + cat > ~/.sbuildrc <&2 + exit 1 +fi + # To build the chroot, we need to know which release of Ubuntu to debootstrap RELEASE="$1" if [ -z "$RELEASE" ]; then