From patchwork Thu Jan 3 20:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1020496 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D0CENrwe"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43W09D5WMDz9s7h for ; Fri, 4 Jan 2019 07:37:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A7A368637A; Thu, 3 Jan 2019 20:37:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id meZKTutIHgEj; Thu, 3 Jan 2019 20:37:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id DFEBC86365; Thu, 3 Jan 2019 20:37:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 20DCE1C2A15 for ; Thu, 3 Jan 2019 20:37:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1C041870C7 for ; Thu, 3 Jan 2019 20:37:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IMVGMAI99arT for ; Thu, 3 Jan 2019 20:37:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 40A50870A1 for ; Thu, 3 Jan 2019 20:37:43 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id f9so30062259eds.10 for ; Thu, 03 Jan 2019 12:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=loHmI8p/auT2QOPf8L09hln9fh0echZTDCj8gw5imyI=; b=D0CENrwel9/lXzgcmuYAvSb84/+MhAA9k1x0y4HZAwqfIHrMMnrv6+Bld3b2QhKfQ7 Ww+HRECkHyPgtrwMVAABSI8+30jsiVNTxqUaQWZiFpzw+TkB3fCSANUKjh5OC7PjXadH 0Ab4/TvyFr2t0CFLS3QjKN9gc9Vti7zPo2B52UEqIxYYFCiSYkxs2HeRbIWsz9Nso4yd 072rJWp82FH5mcqfW8pJOYn7du+8Pkz2mRJjgXB07P7RgQnym5bhRy2kamU/6CHCdqBN 2J7FO/8Mb1GzWp21Ps5g71yWzC97K6RQwfPeyhAhlPydesPHeY/u3qNwn/SNSLvdQzUl NmhQ== 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; bh=loHmI8p/auT2QOPf8L09hln9fh0echZTDCj8gw5imyI=; b=D2kNDwJgQZEC7KDpYLcjQ8+DsTl6iHMVtqJdgyuy7g0Ogdo5Nv40xn9tFOHxvHdNX4 LR6dslJq5LYJqsN3a9SWpnQQnWA3LlbTdWyF9qlpIHrDOLBiU2dh7uXlgBNf2Phn9CTv 3RtO/npLFg1a9/HkdSjAf8qUxIcR9GzxQes2slQwhi5OuBMOR561La4/GOvsmU1LUV9R paC2wFXKoheWdqHRZVz7CPVSIY3Rptn/hJ+7Q3Urr5YXvjRser61SA+rxMejnrnF8M7e 1tC1uFI3z0xYkWC55NJtBfBueUMylczuaPOpcVTixSndEMrKFgKFvhOCL/SqZi/MxJMt FQMw== X-Gm-Message-State: AA+aEWbM+QJq1DSusKIAujhelXMnGrW+1SGzwqWIMR0PBchOLEci3dNx zCBdTp+QvgXfjhpuq62xdjFC9L8DnEA= X-Google-Smtp-Source: AFSGD/WTcyQldj8EpaIH/QKiTTOWsL5Pkqbgc3HNVXi+1K21CWdQVAD0ZogQqrOnx3GZHhD01zNLsg== X-Received: by 2002:a17:906:90d9:: with SMTP id v25-v6mr37149477ejw.214.1546547861392; Thu, 03 Jan 2019 12:37:41 -0800 (PST) Received: from localhost.localdomain (d54C493B0.access.telenet.be. [84.196.147.176]) by smtp.gmail.com with ESMTPSA id p1-v6sm13452926ejo.49.2019.01.03.12.37.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jan 2019 12:37:40 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Thu, 3 Jan 2019 21:40:24 +0100 Message-Id: <20190103204026.23512-10-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190103204026.23512-1-patrickdepinguin@gmail.com> References: <20190103204026.23512-1-patrickdepinguin@gmail.com> Subject: [Buildroot] [PATCH 09/11] support/download: implement source-check in bzr backend X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" , Thomas De Schampheleire MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire The implementation is the same as originally was present. It suffers from the disadvantage that an invalid revision on a valid URL will not be detected. If someone is proficient in bzr-speak, please improve. Signed-off-by: Thomas De Schampheleire --- support/download/bzr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/support/download/bzr b/support/download/bzr index 5289a421cd..2f13a607c9 100755 --- a/support/download/bzr +++ b/support/download/bzr @@ -7,6 +7,7 @@ set -e # # Options: # -q Be quiet +# -C Only check that the changeset exists in the remote repository # -o FILE Generate archive in FILE. # -u URI Clone from repository at URI. # -c CSET Use changeset (or revision) CSET. @@ -20,6 +21,7 @@ verbose= while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do case "${OPT}" in q) verbose=-q;; + C) checkonly=1;; o) output="${OPTARG}";; u) uri="${OPTARG}";; c) cset="${OPTARG}";; @@ -37,6 +39,13 @@ _bzr() { eval ${BZR} "${@}" } +if [ -n "${checkonly}" ]; then + # TODO this check only checks that the remote repository exists, not that + # it actually contains the requested revision. + _bzr ls --quiet "${@}" "'${uri}'" > /dev/null + exit ${?} +fi + # --per-file-timestamps comes with bzr-2.2 (released August 2010), # so only pass it if bzr is recent enough. We compute versions as: # major*1000 + minor