From patchwork Wed May 26 03:31:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 12416 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7B18DC3200 for ; Wed, 26 May 2021 03:31:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 92F8A68921; Wed, 26 May 2021 05:31:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rDD8jRQz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EC8C1602AB for ; Wed, 26 May 2021 05:31:14 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B91D1332; Wed, 26 May 2021 05:31:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621999874; bh=Yo9nKiBtCaw8Gt/sSXLzuNENhApBC1eYrTCPZ7N4UTA=; h=From:To:Cc:Subject:Date:From; b=rDD8jRQz2G4w9z41TMjzbUUz6ZZRbD2h6YQrta3iRUt0o23jZPT+n1SIqVcWHACTJ XlI+/lZVmizF0kJ6vrwB2Smn+7oUtN/+v01iALzMpchse0M93mtXz35hEcmTdl9UVK MelwrW0toegKpxhKXP26SZ3mkoNngzqMIydAdpng= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 26 May 2021 12:31:00 +0900 Message-Id: <20210526033101.1251279-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/2] utils: update-mojo.sh: Add script for updating mojo X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a script to ease updating mojo from a chromium source tree. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Tested-by: Niklas Söderlund --- Changes in v3: - remove the patch to template_expander.py Changes in v2: - clean mojo/public/tools/* first - use [ instead of test - use scope instead of restoring cd - add todo to remove the jinja2 3.0.0 patch --- utils/update-mojo.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 utils/update-mojo.sh diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh new file mode 100755 index 00000000..fcbc81e7 --- /dev/null +++ b/utils/update-mojo.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +# SPDX-License-Identifier: GPL-2.0-or-later +# Update mojo copy from a chromium source tree + +if [ $# != 1 ] ; then + echo "Usage: $0 " + exit 1 +fi + +ipc_dir="$(dirname "$(realpath "$0")")/ipc" +chromium_dir="$1" + +if [ ! -d "${chromium_dir}/mojo" ] ; then + echo "Directory ${chromium_dir} doesn't contain mojo" + exit 1 +fi + +if [ ! -d "${chromium_dir}/.git" ] ; then + echo "Directory ${chromium_dir} doesn't contain a git tree" + exit 1 +fi + +# Get the chromium commit id +version=$(git -C "${chromium_dir}" rev-parse --short HEAD) + +# Reject dirty trees +if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then + echo "Chromium tree in ${chromium_dir} is dirty" + exit 1 +fi + +# Copy the diagnosis file +cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" "${ipc_dir}/tools/diagnosis" + +# Copy the rest of mojo +cp "${chromium_dir}/mojo/public/LICENSE" "${ipc_dir}/mojo/public" + +rm -rf "${ipc_dir}/mojo/public/tools/*" + +( + cd "${chromium_dir}" || exit + find ./mojo/public/tools -type f \ + -not -path "*/generators/*" \ + -not -path "*/fuzzers/*" \ + -exec cp --parents "{}" "${ipc_dir}" ";" +) + +# Update the README files +readme=$(cat < "${ipc_dir}/mojo/README" +echo "$readme" > "${ipc_dir}/tools/README" + +cat <