From patchwork Tue Jul 24 10:51:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 142764 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp7127233ljj; Tue, 24 Jul 2018 04:05:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfMrXWwQlmpk9ZY09k7IU9Rkdiv8l3Im/K8W755gdXJVCWD4UwAusSQ5t/Gj2Xm4E/rHUoW X-Received: by 2002:a37:6043:: with SMTP id u64-v6mr14426313qkb.160.1532430308835; Tue, 24 Jul 2018 04:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532430308; cv=none; d=google.com; s=arc-20160816; b=mlqxYneDd3FTa6BwQ7/qG7B9p7lAmstZk5eWCFJ2ujo9o+6POD9P7RsjYizxWrdmR1 npRQBK9TF2lsKBHRpb6midiRqsEfwjduTkagey89PPbSkytvSeKR8R3mX9mwbiyQnPQ6 LYaI7QUgzmQZKyCr7wGEzmbWQW4mbaERwDga/fXt6DlpCOfe0ox29kzYFWxGOwMwz/vg i1ghmq7dAJSqfcjJ08ehP6wd24OZ8e1COdeIBWAHYFE8ZWVd1nXgfm5rwEchWwpilM7c VX8jbHDttfULSANCa+KbfdaWcW+iaFbHcytWznFAu2ISimQgkIGYXpth5kt9744t5CMP BEYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=k+ndgvtDn3eLRElCpCPjGJckcWE4KOtFS46rdAqN8gE=; b=IhN8NOOk2IZPSrgHwEJcCpA+3kYRNfDk0vznC/i5zvVQ4Sqg+KU9cL7sb5+geMC/AV nL+cSY6/yhI9u394n73SgbRs0afTyPxRqgdyb5z2c+G1NtYVSTbVBJ8j/9TpuxQZsuma IY4dUeBRlf56YkmfKWPT2Xe209HHhJeIDuSzn/LV7z849HA1wiTiIFVHDeWvsqNxTwPl d1pZhuaVQthyjT2Cd0pN6lg4r7Gj4BZCnrsSYbEM/VAYFQDIbLv2VLv2sinzrzAhK1hP AGqfRMuzoL4CumGCyRQXZDjoLJQ/gpDodcluISWy6VQnHrZZ7bmvUoTNsKxKvczebnxT WXsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QH+DwaIt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c25-v6si3781827qtk.313.2018.07.24.04.05.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Jul 2018 04:05:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QH+DwaIt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhv7s-0003Da-7T for patch@linaro.org; Tue, 24 Jul 2018 07:05:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhuuf-00011k-0C for qemu-devel@nongnu.org; Tue, 24 Jul 2018 06:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhuuc-0006YU-4a for qemu-devel@nongnu.org; Tue, 24 Jul 2018 06:51:29 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhuub-0006YK-Tk for qemu-devel@nongnu.org; Tue, 24 Jul 2018 06:51:26 -0400 Received: by mail-wr1-x441.google.com with SMTP id e7-v6so3655459wrs.9 for ; Tue, 24 Jul 2018 03:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k+ndgvtDn3eLRElCpCPjGJckcWE4KOtFS46rdAqN8gE=; b=QH+DwaItTfDJrMiOMSEVNx+OZW54xxkPPVvHmsbCj/K4lTzLlHQcyGitFY+Eo57O7d 07NV5uufNKkdmgozJMFuydx7kKt+Ch8rMdiEe4pWMr9tLF4PduLjoV6p4iC+6+Akd7ai /BStzLquVmfDGqHOVpT2M6eomKHpoUvu4nHYs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k+ndgvtDn3eLRElCpCPjGJckcWE4KOtFS46rdAqN8gE=; b=Pa58jAl2BMXnyNGtUgCkLuFQg1GzUAw1mtiPYwDdZo3K4XJxaTwD+saJZsZwdli5XO iRhI4r5mmVb87f9oAcoU0A+jcjB43q9nkiTPJWdlncKbXB3rcLzN73INZGp81ZnHPw41 lKN+3yEDF5exixxCmqw1qChLyYViarVk1d0QLOtuCiF68i9OOrr1b7XkyiRjGVeGLNtV tDbEe7D12bb4vW8VjrZ5Fbx0bhX+kGVCIQvajKJMqWG+0jCOv+PVnDWOZgjaXhKWINO3 BE4sefnZaSP17l/dCS4Cxps35Ct+8cevjieg98OHURMKoGeADhTAjzw4RcU0dQdVdccg DkDA== X-Gm-Message-State: AOUpUlEYufZjvDpMt9Ay3Oz09LW0J6Z/zr1fnN31ZxTqLFukNjVGnVM9 Y8Eh3IRsEcVUeWrw1iQshYJOPg== X-Received: by 2002:adf:cd0e:: with SMTP id w14-v6mr10511547wrm.226.1532429484843; Tue, 24 Jul 2018 03:51:24 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 5-v6sm1921804wmv.48.2018.07.24.03.51.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 03:51:19 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 0F23A3E050B; Tue, 24 Jul 2018 11:51:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 24 Jul 2018 11:51:07 +0100 Message-Id: <20180724105109.8392-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180724105109.8392-1-alex.bennee@linaro.org> References: <20180724105109.8392-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PULL 15/17] docker: ignore distro versioning of debootstrap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do a minimum version check for the debootstrap but if the distro has added their own minor version tick it would fail and fall-back to the SCM version. This is sub-optimal as the latest/greatest version may be broken at any one particular time. We fix that with a little sed magic on the version string before passing to our ugly shell versioning check. Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé -- 2.17.1 diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre index ea324d6e4a..3b0ef95374 100755 --- a/tests/docker/dockerfiles/debian-bootstrap.pre +++ b/tests/docker/dockerfiles/debian-bootstrap.pre @@ -56,10 +56,13 @@ if [ -z $DEBOOTSTRAP_DIR ]; then if [ -z $DEBOOTSTRAP ]; then echo "No debootstrap installed, attempting to install from SCM" NEED_DEBOOTSTRAP=true - elif ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; "${DEBOOTSTRAP}" --version \ - | cut -d ' ' -f 2) | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -c &>/dev/null; then - echo "debootstrap too old, attempting to install from SCM" - NEED_DEBOOTSTRAP=true + else + INSTALLED_VERSION=$(${DEBOOTSTRAP} --version | sed 's/debootstrap \([0-9\.]*\)[^0-9\.]*.*/\1/') + if ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; echo "${INSTALLED_VERSION}") \ + | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -C ; then + echo "debootstrap too old, attempting to install from SCM" + NEED_DEBOOTSTRAP=true + fi fi if $NEED_DEBOOTSTRAP; then DEBOOTSTRAP_SOURCE=https://salsa.debian.org/installer-team/debootstrap.git