From patchwork Mon Feb 15 16:20:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chase Douglas X-Patchwork-Id: 45399 X-Patchwork-Delegate: stefan.bader@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id EB9C6B7CBD for ; Tue, 16 Feb 2010 03:23:32 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh3jL-0006J7-93; Mon, 15 Feb 2010 16:23:27 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh3gp-0005jg-8u for kernel-team@lists.ubuntu.com; Mon, 15 Feb 2010 16:20:51 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1Nh3gn-00086k-GE for ; Mon, 15 Feb 2010 16:20:49 +0000 Received: from cpe-75-180-27-10.columbus.res.rr.com ([75.180.27.10] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Nh3gn-0008O6-7i for kernel-team@lists.ubuntu.com; Mon, 15 Feb 2010 16:20:49 +0000 From: Chase Douglas To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] Check for valid chroots Date: Mon, 15 Feb 2010 11:20:23 -0500 Message-Id: <1266250823-12394-3-git-send-email-chase.douglas@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1266250823-12394-1-git-send-email-chase.douglas@canonical.com> References: <1266250823-12394-1-git-send-email-chase.douglas@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Before, if schroot or dchroot were found they were used (in that order) whether or not there were any chroots defined. This change checks for whether any chroots are available before assuming the found chroot executable will work. Signed-off-by: Chase Douglas --- buildscripts/build-create-host | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildscripts/build-create-host b/buildscripts/build-create-host index 5bf163e..14fd228 100755 --- a/buildscripts/build-create-host +++ b/buildscripts/build-create-host @@ -19,9 +19,9 @@ CMD='if [ "\`type -p dpkg-architecture\`" != "" ]; then else echo HOSTARCH="\`dpkg --print-architecture\`"; fi; -if [ "\`type -p schroot\`" != "" ]; then +if [ "\`type -p schroot\`" != "" ] && ! schroot -l 2>&1 | egrep -q "(W|E): "; then CHROOTCMD="schroot"; -elif [ "\`type -p dchroot\`" != "" ]; then +elif [ "\`type -p dchroot\`" != "" ] && ! dchroot -l 2>&1 | egrep -q "(W|E): "; then CHROOTCMD="dchroot"; else exit 1;