[{"id":17263,"web_url":"https://patchwork.libcamera.org/comment/17263/","msgid":"<YK4EVbEv3hXoyTDz@oden.dyn.berto.se>","date":"2021-05-26T08:18:29","subject":"Re: [libcamera-devel] [PATCH v3 1/2] utils: update-mojo.sh: Add\n\tscript for updating mojo","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Paul,\n\nThanks for your work.\n\nOn 2021-05-26 12:31:00 +0900, Paul Elder wrote:\n> Add a script to ease updating mojo from a chromium source tree.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThis and 2/2 fix my jinja issues so for both 1/2 and 2/2:\n\nTested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> \n> ---\n> Changes in v3:\n> - remove the patch to template_expander.py\n> \n> Changes in v2:\n> - clean mojo/public/tools/* first\n> - use [ instead of test\n> - use scope instead of restoring cd\n> - add todo to remove the jinja2 3.0.0 patch\n> ---\n>  utils/update-mojo.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 66 insertions(+)\n>  create mode 100755 utils/update-mojo.sh\n> \n> diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh\n> new file mode 100755\n> index 00000000..fcbc81e7\n> --- /dev/null\n> +++ b/utils/update-mojo.sh\n> @@ -0,0 +1,66 @@\n> +#!/bin/sh\n> +\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +# Update mojo copy from a chromium source tree\n> +\n> +if [ $# != 1 ] ; then\n> +\techo \"Usage: $0 <chromium dir>\"\n> +\texit 1\n> +fi\n> +\n> +ipc_dir=\"$(dirname \"$(realpath \"$0\")\")/ipc\"\n> +chromium_dir=\"$1\"\n> +\n> +if [ ! -d \"${chromium_dir}/mojo\" ] ; then\n> +\techo \"Directory ${chromium_dir} doesn't contain mojo\"\n> +\texit 1\n> +fi\n> +\n> +if [ ! -d \"${chromium_dir}/.git\" ] ; then\n> +\techo \"Directory ${chromium_dir} doesn't contain a git tree\"\n> +\texit 1\n> +fi\n> +\n> +# Get the chromium commit id\n> +version=$(git -C \"${chromium_dir}\" rev-parse --short HEAD)\n> +\n> +# Reject dirty trees\n> +if [ -n \"$(git -C \"${chromium_dir}\" status --porcelain)\" ] ; then\n> +\techo \"Chromium tree in ${chromium_dir} is dirty\"\n> +\texit 1\n> +fi\n> +\n> +# Copy the diagnosis file\n> +cp \"${chromium_dir}/tools/diagnosis/crbug_1001171.py\" \"${ipc_dir}/tools/diagnosis\"\n> +\n> +# Copy the rest of mojo\n> +cp \"${chromium_dir}/mojo/public/LICENSE\" \"${ipc_dir}/mojo/public\"\n> +\n> +rm -rf \"${ipc_dir}/mojo/public/tools/*\"\n> +\n> +(\n> +\tcd \"${chromium_dir}\" || exit\n> +\tfind ./mojo/public/tools -type f \\\n> +\t     -not -path \"*/generators/*\" \\\n> +\t     -not -path \"*/fuzzers/*\" \\\n> +\t     -exec cp --parents \"{}\" \"${ipc_dir}\" \";\"\n> +)\n> +\n> +# Update the README files\n> +readme=$(cat <<EOF\n> +# SPDX-License-Identifier: CC0-1.0\n> +\n> +Files in this directory are imported from ${version} of Chromium. Do not\n> +modify them manually.\n> +EOF\n> +)\n> +\n> +echo \"$readme\" > \"${ipc_dir}/mojo/README\"\n> +echo \"$readme\" > \"${ipc_dir}/tools/README\"\n> +\n> +cat <<EOF\n> +------------------------------------------------------------\n> +mojo updated. Please review and up-port local changes before\n> +committing.\n> +------------------------------------------------------------\n> +EOF\n> -- \n> 2.27.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E8B1AC3203\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 May 2021 08:18:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A1906891F;\n\tWed, 26 May 2021 10:18:32 +0200 (CEST)","from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n\t[IPv6:2a00:1450:4864:20::22c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C0C246891E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 May 2021 10:18:30 +0200 (CEST)","by mail-lj1-x22c.google.com with SMTP id f12so524318ljp.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 May 2021 01:18:30 -0700 (PDT)","from localhost (h-62-63-236-217.A463.priv.bahnhof.se.\n\t[62.63.236.217]) by smtp.gmail.com with ESMTPSA id\n\te17sm2369208ljl.73.2021.05.26.01.18.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 26 May 2021 01:18:29 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"WZNLZ7lW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=kRkRTtGppcaH8OsUb0Cpmx1sACU1SXr63+ccjAzaTGM=;\n\tb=WZNLZ7lWbBscO6GUNLW1LZzCXdNc1WeKuFTf7VC64Q8BncKtdqMb72nf/WO/c6+d54\n\tF0qYLLpRDW09xwS/8xqL8tCTRUCFpDAFvflz6z97BmxRAuiVT5yYDtbLJjNyjsnvkyfT\n\te/7/fxXrfsPiSK3OssqIN1j61ovMh79Z4jlWBal188tfHb+IBwnTc//X1qMFUS+S7Oot\n\tyeHKGCSFrNBA4KTqKGx7vriCNU2Uifa2KEYE2dXmhD5DXXJGC0eX8W8e97twXa65CT3R\n\tJ4ucoNbhsq62Q/fkYNi1pcT/8RV14UmpWoNxT2GJBrjC/+Sr90Khn/fC1wr0eIpRc3hq\n\tlmUg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=kRkRTtGppcaH8OsUb0Cpmx1sACU1SXr63+ccjAzaTGM=;\n\tb=WQ8lPYY/4DnO+HsJTeEpBLmoPjdlcqU+sJUmh2mkBF4EEKtBtS1DbccX0PHb/qHf6r\n\tpWKPA/WmG+e+1kGpbh8UybkW7SeuMw4MoVmGhcuj1sbJnuMn+927+4QnNAzUTcGKL1EP\n\t0nOMAQFV8PImfoBMai4ZlbFmezdZEW4p1QT9kpSmBG/IyRFCkycLpV5MU3rgTfXISsoc\n\tVz+3JdosMXBZ+8pkpHUoz1XQVccvZtZYjJCBr8L8WT1eqC3JsGcX8cu83HDm6nSF+H1k\n\thOJxjPvUu+2AFMIt5ctZx9vqVeW28T2svZB6og6wM1QJt/iG+ickgH/w2C9vPDHYVD57\n\tKaGg==","X-Gm-Message-State":"AOAM530AkNapns38oDJ470KTl5eG9Wvvqg95x9isUAHZYRTf5XgwRg9f\n\tlXVmCJxCPmIfWugj9d6fwfvbU1LvB8QMbQ==","X-Google-Smtp-Source":"ABdhPJxK5cTvzAHaJVv40L7UVsdkg7ymqhDRtH7ELOLLJYazL6GDkyKkEMfxIe4Bx2y5SJL1n3mfeA==","X-Received":"by 2002:a05:651c:119c:: with SMTP id\n\tw28mr1358621ljo.164.1622017110243; \n\tWed, 26 May 2021 01:18:30 -0700 (PDT)","Date":"Wed, 26 May 2021 10:18:29 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<YK4EVbEv3hXoyTDz@oden.dyn.berto.se>","References":"<20210526033101.1251279-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210526033101.1251279-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 1/2] utils: update-mojo.sh: Add\n\tscript for updating mojo","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]