From patchwork Sat Feb 9 20:23:44 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: 1039289 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.136; helo=silver.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="f1xi9KB7"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43xk6H28KMz9sMr for ; Sun, 10 Feb 2019 07:24:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 452E723C58; Sat, 9 Feb 2019 20:24:04 +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 3w4HT0vTcas5; Sat, 9 Feb 2019 20:24:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 862E22420F; Sat, 9 Feb 2019 20:23:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2E15E1BF82F for ; Sat, 9 Feb 2019 20:23:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2B33D86777 for ; Sat, 9 Feb 2019 20:23:55 +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 eNBpG44BXlL3 for ; Sat, 9 Feb 2019 20:23:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id DBB54867C0 for ; Sat, 9 Feb 2019 20:23:51 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id a2so5649559edi.0 for ; Sat, 09 Feb 2019 12:23:51 -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 :mime-version:content-transfer-encoding; bh=HlhMzlkjtYuMdelGzOZZHA03AmJ7avpNMBrcjdMCFFg=; b=f1xi9KB7a8s76nwbpvTacSDVZQ3eg1lbwkIZVVWKyVxmLQ5BytofnClDsJiQqqblkb d1ROhpsg7h9CswpbL9ggwftzeVkAIUcxddsGhIcp5IxAdzQxaDeH4ZHLZaQrp+ioWRlp 11wzDZoTm5sZeZsYgarxrJdlOF6RR2TdVf8KEQiyZUVA5XOCkl0+L+4ra0ayNhy0MgE2 ED7r6oQxHHLzyPO1vMAvPw46JEN5zixcKMT2iWY90ySxTzZxIEcEVRgZr2WDbjwIackQ n3HihN/YW5t7MTTqsWGL3uI7b/h3y2gvIp/tc8DHLtqG8i/a2QTp8JvVhZjVuB6p1MA6 9nXA== 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=HlhMzlkjtYuMdelGzOZZHA03AmJ7avpNMBrcjdMCFFg=; b=KX/YQ1KBMB0lkN6HyFn1f4cHjn+KKi9Es4kjXSPE1450kEodZnJLi4ajWkt+B5Ns/d +ROAPSIelB72lfMMi6782Jk1I899YnhL2DwxOaN1u0bNzcbTbdjmhWP/iJmDsLJxnIlf dyER59/bUxoZBuBWZurRZM0SHtHI27IPZIPXUJLsWfLSBCmPUXlyknD/rI/bpJpR8OrY fuZYlJQYZ5Ip8bPHbas2xwec3ilKWcE68hDtALZNOYl6n6eltrTgUV3z8lDPV3chxzGh bIaT0QjiSJSK0vedmoS7JXxQKkf5zMFaCrhNOtzXxJc36HsZzbDwRjWEn+jB7k3et2J3 FfOQ== X-Gm-Message-State: AHQUAuaDhoGGu8MOy/cMvHKHgvfl7lC6v39/mz8ggk9B0uO3H4Otewnt 8ZbizFIqvIGf8yg14rEMB6stFTDJveA= X-Google-Smtp-Source: AHgI3IaARonjxTmTERQ16ag4/UrkWgE+SoEAxtS+kFS6ZqbclZRr4wrhq+yMZZcazXm7KzcMFk2wGg== X-Received: by 2002:a17:906:6dc8:: with SMTP id j8mr15313072ejt.210.1549743830085; Sat, 09 Feb 2019 12:23:50 -0800 (PST) Received: from localhost.localdomain (d54C493B0.access.telenet.be. [84.196.147.176]) by smtp.gmail.com with ESMTPSA id j16sm492310edt.81.2019.02.09.12.23.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Feb 2019 12:23:49 -0800 (PST) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Sat, 9 Feb 2019 21:23:44 +0100 Message-Id: <20190209202350.4984-2-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190209202350.4984-1-patrickdepinguin@gmail.com> References: <20190209202350.4984-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv3 2/7] support/download/hg: implement source-check 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 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(+) v3: no changes diff --git a/support/download/hg b/support/download/hg index efb515fca5..ed8dcfbcff 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 \