From patchwork Thu Jan 3 20:40:19 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: 1020490 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="o74Ya+tP"; 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 43W09425qhz9s9G for ; Fri, 4 Jan 2019 07:37:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D26FA85582; Thu, 3 Jan 2019 20:37:40 +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 i3Fe59TIMYNs; Thu, 3 Jan 2019 20:37:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7C5AB8628E; Thu, 3 Jan 2019 20:37:39 +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 C89E91C2A15 for ; Thu, 3 Jan 2019 20:37:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C616B232D7 for ; Thu, 3 Jan 2019 20:37:37 +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 8jk3HvXWtUil for ; Thu, 3 Jan 2019 20:37:37 +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 silver.osuosl.org (Postfix) with ESMTPS id 29F8B232D2 for ; Thu, 3 Jan 2019 20:37:37 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id f9so30062051eds.10 for ; Thu, 03 Jan 2019 12:37:37 -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=PfFF4FqMT7iRPFZbnCs/n035fbd6sij1nQwSd/LT0+M=; b=o74Ya+tPJ33b7Ziau2CpjxOApr6WR4VU5AZNBBbVT/gHjesiXvDf/+nuF+94IGBChS nkRUop9CjCAv5dMWsRXuUWy+Qa2Edj0XSdr4Z+/3YWLE6qZ6WxDEccYr2cxkdi60uZoZ gePMyt4wM7zyf+Ub4AHpAIItQm+Qqkf7cp+ZPPhIyDSfU8CKiJqbmlnKC7MThuSXgvw5 WJO2FbirXHTmAz6amMNQ77CEHsmmPsvYR7jhJQniMkSTxo1Jh5FfaeeKBADOLcHGf9VS DN/sfHV4hjVt57w97K6A/4MdoZwaS0Vu9asqoNTePeE0DSVHQ6cYfW2IIx9lcvZj0Ywc Y0CA== 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=PfFF4FqMT7iRPFZbnCs/n035fbd6sij1nQwSd/LT0+M=; b=QTHS4anXRADqewAKsshvQkDD+DGdR33ODSkIveURjLheBmd4DopVi5IECGHALm5MtL e5GIkgBlh1jSxv4wW1lRmwvxkG5ZFAyEp4TQBf2FZKgo57DWaG7aL5kcHRkAy5r7PAu/ uqGSwdGHaz8IsUIXbJQvaSipwp39ncpio2yCDA7LepKn7cXROVoH2hKrnABrv1y5ZMxr NPhZZU3/RuB2iBr6NRqjc8E5+BZjlPzU9CKR/aa4QRoH40GiMrixWdTdHeWceF2dZfGa 777o+tni/j/cxuVYg0Z54+7RjR9NywW+Td2SaDkTujHd7fdVaNrofxBzkb5iJJHkoN6n Cy6g== X-Gm-Message-State: AA+aEWaWJpVsUK1z0uuTSg4DcB/zQJi+EQLoj2JGBEpDwPJj7ca1yDPS 8zVgJTcZa0hEGzvmIqQg8qv8ukMuPHw= X-Google-Smtp-Source: AFSGD/VqGq8w+0ZXx0K25qfrXFbg3qOjA8ZHA7ArwOX9A+N5/ILQ2D84oJI7WyxLpQPpa115puSjKA== X-Received: by 2002:a17:906:6c14:: with SMTP id j20-v6mr36875826ejr.41.1546547855279; Thu, 03 Jan 2019 12:37:35 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Jan 2019 12:37:34 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Thu, 3 Jan 2019 21:40:19 +0100 Message-Id: <20190103204026.23512-5-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 04/11] support/download: implement source-check in hg 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 Note: the implementation is different (better) than what used to be in Buildroot before source-check was removed. The original implementation: hg incoming --force -l1 would only verify that the repository exists, not that the requested revision is present. An already better implementation is: hg incoming --force -l1 -r but compared to the next solution it has a large resource consumption on the local machine. In the background, the full repository is first downloaded. The implemented solution is: hg identify -r which operates directly on the remote repository. Signed-off-by: Thomas De Schampheleire --- support/download/hg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/support/download/hg b/support/download/hg index efb515fca5..7c698ee7e3 100755 --- a/support/download/hg +++ b/support/download/hg @@ -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. @@ -19,6 +20,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}";; @@ -36,6 +38,11 @@ _hg() { eval ${HG} "${@}" } +if [ -n "${checkonly}" ]; then + _hg identify ${verbose} "${@}" --rev "'${cset}'" "'${uri}'" > /dev/null + exit ${?} +fi + _hg clone ${verbose} "${@}" --noupdate "'${uri}'" "'${basename}'" _hg archive ${verbose} --repository "'${basename}'" --type tgz \