From patchwork Thu Jan 3 20:40:25 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: 1020497 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.137; helo=fraxinus.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="YA4GpBsT"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43W09K32Z8z9s7h for ; Fri, 4 Jan 2019 07:37:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F08F185C62; Thu, 3 Jan 2019 20:37:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B0LhEWpTiKwu; Thu, 3 Jan 2019 20:37:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2351585C67; Thu, 3 Jan 2019 20:37:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7D13B1C2A15 for ; Thu, 3 Jan 2019 20:37:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 75C55232D7 for ; Thu, 3 Jan 2019 20:37:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VXRZU1g0OS8L for ; Thu, 3 Jan 2019 20:37:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by silver.osuosl.org (Postfix) with ESMTPS id 706242338F for ; Thu, 3 Jan 2019 20:37:44 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id h15so30088488edb.4 for ; Thu, 03 Jan 2019 12:37:44 -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=g4BN/ENPs4z2IHUVYA4Vz7LG1x6NqDdHL5ZmWileXms=; b=YA4GpBsTI8DI9AGFK3isAb3oMauKqx6DeC0GyFoX7uvI58P1NnrwF8wgeMpdKdrC2i Y5yFfi5RjPBdjHT9JSRKUYM2/1urSo0tv9e8PaVGZFGoTEQyAcTXO8sD305xK/RdJcU7 1d8googkZJdSrBHY9NIbzKy6FhPnOsNneK1rqHBpsbaaCrC4PD595D0iXY7LVy/YEIsH DTjgmQipGulpxCpbEuVZKVrLlSh4RbH+hWfPaGqtic2z46F4XY1D7NUlXp+cTUismZx+ tMc9qjqmwhPI8ozA+Hv3+VcIUj0FcXuRIh5b5Y/sOiiSVjLl9RChnD4Op7GjzkcQtpKE Iquw== 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=g4BN/ENPs4z2IHUVYA4Vz7LG1x6NqDdHL5ZmWileXms=; b=n0zQfqpMbhbRj58/5eTUbIx9orRfKp0bwU/OSf3D2f+xn5PIi5er8nfXY3t0KT9/P2 iyJYzgAWWbK8Zy4Ud8WFeUvZpC+4Gseg5PYg5GwBng58RWz/7/Iuf0xg1A8GOpt26bSg Z7Lsw7+vG7ZM1HA5Pn6ed3v9PLXlmLT0mIuwwM/qYtixNZxvewnnmHHJzdPu86N5U7th ZDhBv7qVNZDaax65XIdWcSEvIMPrjhObttyl3oY/EaP+HDjhh4T+AXg4BpA0crnQhW0q ULSE4MrVFxK8h2YqLKrbYpTlKQGT2v/kEbjCPjwP/rrnN6Q+qAcAlhvptox6omyL1PXU 7nsQ== X-Gm-Message-State: AA+aEWbA+lO7vP8+DqJqhT7oPZhKZrQLoCTkoMDAu2+juzUxWr6IMW8F V59Hj/ym07PBT0fJasfr7WZeRP3pK04= X-Google-Smtp-Source: AFSGD/U42JdpV5lCDJ5pVNCRFGBjqe++N7QFBMuwf96uFlpiRoFy8FPVRsTUK62I4GWl09wW4x+oOQ== X-Received: by 2002:a50:de88:: with SMTP id c8mr43490790edl.129.1546547862674; Thu, 03 Jan 2019 12:37:42 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jan 2019 12:37:42 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Thu, 3 Jan 2019 21:40:25 +0100 Message-Id: <20190103204026.23512-11-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 10/11] support/download: implement source-check in cvs 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. Signed-off-by: Thomas De Schampheleire --- support/download/cvs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/support/download/cvs b/support/download/cvs index 9d0dc3cb3a..0ae7aa30d2 100755 --- a/support/download/cvs +++ b/support/download/cvs @@ -7,6 +7,7 @@ set -e # # Options: # -q Be quiet +# -C Only check that the revision exists in the remote repository # -o FILE Generate archive in FILE. # -u URI Checkout from repository at URI. # -c REV Use revision REV. @@ -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) rev="${OPTARG}";; @@ -57,6 +59,15 @@ if [[ ! "${uri}" =~ ^: ]]; then fi export TZ=UTC + +if [ -n "${checkonly}" ]; then + # Not all CVS servers support ls/rls, use login to see if we can connect. + # TODO this check only checks that the remote repository exists, not that + # it actually contains the requested revision. + _cvs ${verbose} -d"'${uri}'" login + exit ${?} +fi + _cvs ${verbose} -z3 -d"'${uri}'" \ co "${@}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"