[libcamera-devel,1/8] utils: update-mojo.sh: Properly remove old sources
diff mbox series

Message ID 20240104151548.2589-2-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
The update-mojo.sh script starts by removing all sources before copying
the new files from chromium. A bug in the 'rm' command makes the removal
a no-op: the glob pattern is quoted, which attempts to remove a file
name '*' in the tools directory, not all files in the directory. Fix it
by removing the whole utils/ipc/mojo/ directory.

While at it, also remove the utils/ipc/tools/ directory that contains
imported sources.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 utils/update-mojo.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

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

> The update-mojo.sh script starts by removing all sources before copying
> the new files from chromium. A bug in the 'rm' command makes the removal
> a no-op: the glob pattern is quoted, which attempts to remove a file
> name '*' in the tools directory, not all files in the directory. Fix it
> by removing the whole utils/ipc/mojo/ directory.
>
> While at it, also remove the utils/ipc/tools/ directory that contains
> imported sources.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  utils/update-mojo.sh | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
> index fcbc81e70529..967d139a3f70 100755
> --- a/utils/update-mojo.sh
> +++ b/utils/update-mojo.sh
> @@ -30,14 +30,18 @@ if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
>  	exit 1
>  fi
>  
> +# Remove the previously imported files.
> +rm -rf "${ipc_dir}/mojo/"
> +rm -rf "${ipc_dir}/tools/"
> +
>  # Copy the diagnosis file
> +mkdir -p "${ipc_dir}/tools/diagnosis"
>  cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" "${ipc_dir}/tools/diagnosis"
>  
>  # Copy the rest of mojo
> +mkdir -p "${ipc_dir}/mojo/public"
>  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 \
Kieran Bingham Jan. 9, 2024, 12:08 p.m. UTC | #2
Quoting Laurent Pinchart via libcamera-devel (2024-01-04 15:15:41)
> The update-mojo.sh script starts by removing all sources before copying
> the new files from chromium. A bug in the 'rm' command makes the removal
> a no-op: the glob pattern is quoted, which attempts to remove a file
> name '*' in the tools directory, not all files in the directory. Fix it
> by removing the whole utils/ipc/mojo/ directory.
> 
> While at it, also remove the utils/ipc/tools/ directory that contains
> imported sources.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


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

> ---
>  utils/update-mojo.sh | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
> index fcbc81e70529..967d139a3f70 100755
> --- a/utils/update-mojo.sh
> +++ b/utils/update-mojo.sh
> @@ -30,14 +30,18 @@ if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
>         exit 1
>  fi
>  
> +# Remove the previously imported files.
> +rm -rf "${ipc_dir}/mojo/"
> +rm -rf "${ipc_dir}/tools/"
> +
>  # Copy the diagnosis file
> +mkdir -p "${ipc_dir}/tools/diagnosis"
>  cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" "${ipc_dir}/tools/diagnosis"
>  
>  # Copy the rest of mojo
> +mkdir -p "${ipc_dir}/mojo/public"
>  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 \
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
index fcbc81e70529..967d139a3f70 100755
--- a/utils/update-mojo.sh
+++ b/utils/update-mojo.sh
@@ -30,14 +30,18 @@  if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
 	exit 1
 fi
 
+# Remove the previously imported files.
+rm -rf "${ipc_dir}/mojo/"
+rm -rf "${ipc_dir}/tools/"
+
 # Copy the diagnosis file
+mkdir -p "${ipc_dir}/tools/diagnosis"
 cp "${chromium_dir}/tools/diagnosis/crbug_1001171.py" "${ipc_dir}/tools/diagnosis"
 
 # Copy the rest of mojo
+mkdir -p "${ipc_dir}/mojo/public"
 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 \