{"id":12314,"url":"https://patchwork.libcamera.org/api/1.1/patches/12314/?format=json","web_url":"https://patchwork.libcamera.org/patch/12314/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210519052510.899058-1-paul.elder@ideasonboard.com>","date":"2021-05-19T05:25:10","name":"[libcamera-devel] utils: update-mojo.sh: Add script for updating mojo","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"caa51ce87800366760cd14ae36d31e0f58d4ed17","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12314/mbox/","series":[{"id":2036,"url":"https://patchwork.libcamera.org/api/1.1/series/2036/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2036","date":"2021-05-19T05:25:10","name":"[libcamera-devel] utils: update-mojo.sh: Add script for updating mojo","version":1,"mbox":"https://patchwork.libcamera.org/series/2036/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12314/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12314/checks/","tags":{},"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 29C52C31FF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 May 2021 05:25:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7619268918;\n\tWed, 19 May 2021 07:25:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE971602B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 May 2021 07:25:32 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1C9B645E;\n\tWed, 19 May 2021 07:25:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HX1TiGBo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621401932;\n\tbh=U+ybMrsOeE/yIuENi86r1+GlyETFeL9vwa/7mElG8gs=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=HX1TiGBoVOaxmwumVBPuWL+E+/OpLbRcAy7APxLHKL/yxOq1q1ZKg1gJwv+f8xzzr\n\trJY3BSWNyYWNOWzZD/2zg0uCzi3/Ab1f2dTX2oz9veLfR/dy/x3MXnlf1HIt9fj1Qh\n\tv6LiC0LR7HDaicGpabi2CFOJ7XSf8CXZJ18Mls28=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 19 May 2021 14:25:10 +0900","Message-Id":"<20210519052510.899058-1-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] utils: update-mojo.sh: Add script for\n\tupdating 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a script to ease updating mojo from a chromium source tree.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNote that this script includes the little patch to template_expander.py\nto enable it to work with jinja2 3.0.0 (it still works with jinja2\n2.10.x).\n---\n utils/update-mojo.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 68 insertions(+)\n create mode 100755 utils/update-mojo.sh","diff":"diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh\nnew file mode 100755\nindex 00000000..a57ea968\n--- /dev/null\n+++ b/utils/update-mojo.sh\n@@ -0,0 +1,68 @@\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 ! test -z \"$(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+last_dir=\"$(pwd)\"\n+cd \"${chromium_dir}\" || exit\n+find \"./mojo/public/tools\" -type f \\\n+     -not -path \"*/generators/*\" \\\n+     -not -path \"*/fuzzers/*\" \\\n+     -exec cp --parents \"{}\" \"${ipc_dir}\" \";\"\n+cd \"$last_dir\" || exit\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+# Fix mojo support for jinja2 3.0.0\n+template_expander=\"${ipc_dir}/mojo/public/tools/mojom/mojom/generate/template_expander.py\"\n+sed -i \"/py_compile=.*$/d\" \"${template_expander}\"\n+\n+cat <<EOF\n+------------------------------------------------------------\n+mojo updated. Please review and up-port local changes before\n+committing.\n+------------------------------------------------------------\n+EOF\n","prefixes":["libcamera-devel"]}