From 0e9585ff5bb1da9132be625874c16839debb1ab5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 4 Jan 2024 17:15:43 +0200 Subject: utils: update-mojo.sh: Change to the libcamera source directory Instead of prefixing all paths to IPC files with ${ipc_dir}, change to the libcamera sources root directory and use relative file paths. This simplifies the update script. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- utils/update-mojo.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh index 831f5ab8..b6fbc6d1 100755 --- a/utils/update-mojo.sh +++ b/utils/update-mojo.sh @@ -11,7 +11,9 @@ if [ $# != 1 ] ; then fi ipc_dir="$(dirname "$(realpath "$0")")/ipc" -chromium_dir="$1" +chromium_dir="$(realpath "$1")" + +cd "${ipc_dir}/../../" if [ ! -d "${chromium_dir}/mojo" ] ; then echo "Directory ${chromium_dir} doesn't contain mojo" @@ -33,16 +35,16 @@ if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then fi # Remove the previously imported files. -rm -rf "${ipc_dir}/mojo/" -rm -rf "${ipc_dir}/tools/" +rm -rf utils/ipc/mojo/ +rm -rf utils/ipc/tools/ # Copy the diagnosis file -mkdir -p "${ipc_dir}/tools/diagnosis" -cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" "${ipc_dir}/tools/diagnosis" +mkdir -p utils/ipc/tools/diagnosis/ +cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" utils/ipc/tools/diagnosis/ # Copy the rest of mojo -mkdir -p "${ipc_dir}/mojo/public" -cp "${chromium_dir}/mojo/public/LICENSE" "${ipc_dir}/mojo/public" +mkdir -p utils/ipc/mojo/public/ +cp "${chromium_dir}/mojo/public/LICENSE" utils/ipc/mojo/public/ ( cd "${chromium_dir}" || exit @@ -61,8 +63,8 @@ modify them manually. EOF ) -echo "$readme" > "${ipc_dir}/mojo/README" -echo "$readme" > "${ipc_dir}/tools/README" +echo "$readme" > utils/ipc/mojo/README +echo "$readme" > utils/ipc/tools/README cat <