[libcamera-devel,3/8] utils: update-mojo.sh: Change to the libcamera source directory
diff mbox series

Message ID 20240104151548.2589-4-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Update mojo and mojo updater
Related show

Commit Message

Laurent Pinchart Jan. 4, 2024, 3:15 p.m. UTC
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 <laurent.pinchart@ideasonboard.com>
---
 utils/update-mojo.sh | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

Comments

Milan Zamazal Jan. 5, 2024, 10:07 a.m. UTC | #1
Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> 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 <laurent.pinchart@ideasonboard.com>

Reviewed-by: Milan Zamazal <mzamazal@redhat.com>

> ---
>  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 831f5ab8753b..b6fbc6d14f2d 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 <<EOF
>  ------------------------------------------------------------
Kieran Bingham Jan. 9, 2024, 12:09 p.m. UTC | #2
Quoting Laurent Pinchart via libcamera-devel (2024-01-04 15:15:43)
> 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 <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  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 831f5ab8753b..b6fbc6d14f2d 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 <<EOF
>  ------------------------------------------------------------
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
index 831f5ab8753b..b6fbc6d14f2d 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 <<EOF
 ------------------------------------------------------------