[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4] configure: Add 'mkdir build' check

From: Thomas Huth
Subject: Re: [PATCH v4] configure: Add 'mkdir build' check
Date: Tue, 21 Feb 2023 12:14:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 21/02/2023 12.06, Dinah Baum wrote:
QEMU configure script goes into an infinite error printing loop
when in read only directory due to 'build' dir never being created.

Checking if 'mkdir dir' succeeds prevents this error.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
  configure | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index cf6db3d551..1ef3e7f77d 100755
--- a/configure
+++ b/configure
@@ -31,7 +31,12 @@ then
- mkdir build
+    if ! mkdir build || ! touch $MARKER
+    then
+        echo "ERROR: Could not create ./build directory. Check the permissions 
+        echo "your source directory, or try doing an out-of-tree build."
+        exit 1
+    fi
      touch $MARKER

Nit: I think the final "touch $MARKER" could now be removed, too, since the code either exits above, or runs the "|| ! touch $MARKER" part there already.

Anyway, it's just a nit, and maybe could also be fixed while picking up the patch, thus:

Reviewed-by: Thomas Huth <thuth@redhat.com>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]