[libcamera-devel,4/8] utils: update-mojo.sh: Reject a dirty libcamera tree
diff mbox series

Message ID 20240104151548.2589-5-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
If the libcamera tree is dirty committing the result of the mojo update
will be messy. Bail out in that case.

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

Comments

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

> If the libcamera tree is dirty committing the result of the mojo update
> will be messy. Bail out in that case.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  utils/update-mojo.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
> index b6fbc6d14f2d..25a280e04331 100755
> --- a/utils/update-mojo.sh
> +++ b/utils/update-mojo.sh
> @@ -15,6 +15,12 @@ chromium_dir="$(realpath "$1")"
>  
>  cd "${ipc_dir}/../../"
>  
> +# Reject dirty libcamera trees
> +if [ -n "$(git status --porcelain -uno)" ] ; then
> +	echo "libcamera tree is dirty"
> +	exit 1
> +fi
> +
>  if [ ! -d "${chromium_dir}/mojo" ] ; then
>  	echo "Directory ${chromium_dir} doesn't contain mojo"
>  	exit 1
> @@ -28,7 +34,7 @@ fi
>  # Get the chromium commit id
>  version=$(git -C "${chromium_dir}" rev-parse --short HEAD)
>  
> -# Reject dirty trees
> +# Reject dirty chromium trees
>  if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
>  	echo "Chromium tree in ${chromium_dir} is dirty"
>  	exit 1
Kieran Bingham Jan. 9, 2024, 12:10 p.m. UTC | #2
Quoting Laurent Pinchart via libcamera-devel (2024-01-04 15:15:44)
> If the libcamera tree is dirty committing the result of the mojo update
> will be messy. Bail out in that case.
> 
> 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, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
> index b6fbc6d14f2d..25a280e04331 100755
> --- a/utils/update-mojo.sh
> +++ b/utils/update-mojo.sh
> @@ -15,6 +15,12 @@ chromium_dir="$(realpath "$1")"
>  
>  cd "${ipc_dir}/../../"
>  
> +# Reject dirty libcamera trees
> +if [ -n "$(git status --porcelain -uno)" ] ; then
> +       echo "libcamera tree is dirty"
> +       exit 1
> +fi
> +
>  if [ ! -d "${chromium_dir}/mojo" ] ; then
>         echo "Directory ${chromium_dir} doesn't contain mojo"
>         exit 1
> @@ -28,7 +34,7 @@ fi
>  # Get the chromium commit id
>  version=$(git -C "${chromium_dir}" rev-parse --short HEAD)
>  
> -# Reject dirty trees
> +# Reject dirty chromium trees
>  if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
>         echo "Chromium tree in ${chromium_dir} is dirty"
>         exit 1
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/utils/update-mojo.sh b/utils/update-mojo.sh
index b6fbc6d14f2d..25a280e04331 100755
--- a/utils/update-mojo.sh
+++ b/utils/update-mojo.sh
@@ -15,6 +15,12 @@  chromium_dir="$(realpath "$1")"
 
 cd "${ipc_dir}/../../"
 
+# Reject dirty libcamera trees
+if [ -n "$(git status --porcelain -uno)" ] ; then
+	echo "libcamera tree is dirty"
+	exit 1
+fi
+
 if [ ! -d "${chromium_dir}/mojo" ] ; then
 	echo "Directory ${chromium_dir} doesn't contain mojo"
 	exit 1
@@ -28,7 +34,7 @@  fi
 # Get the chromium commit id
 version=$(git -C "${chromium_dir}" rev-parse --short HEAD)
 
-# Reject dirty trees
+# Reject dirty chromium trees
 if [ -n "$(git -C "${chromium_dir}" status --porcelain)" ] ; then
 	echo "Chromium tree in ${chromium_dir} is dirty"
 	exit 1