[PATCH] configure: Force-remove temp dir

Dan Church posted 1 patch 3 years, 5 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201113162248.4131-1-amphetamachine@gmail.com
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] configure: Force-remove temp dir
Posted by Dan Church 3 years, 5 months ago
Sometimes the compiler will leave a write-protected .o file in the temp
directory, and GNU rm will ask before deleting it unless -f is
specified.

Signed-off-by: Dan Church <amphetamachine@gmail.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 4cef321d9d..663b91a334 100755
--- a/configure
+++ b/configure
@@ -7080,4 +7080,4 @@ done
 echo ' "$@"' >>config.status
 chmod +x config.status
 
-rm -r "$TMPDIR1"
+rm -rf "$TMPDIR1"
-- 
2.29.2


Re: [PATCH] configure: Force-remove temp dir
Posted by Peter Maydell 3 years, 5 months ago
On Fri, 13 Nov 2020 at 16:26, Dan Church <amphetamachine@gmail.com> wrote:
>
> Sometimes the compiler will leave a write-protected .o file in the temp
> directory, and GNU rm will ask before deleting it unless -f is
> specified.
>
> Signed-off-by: Dan Church <amphetamachine@gmail.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 4cef321d9d..663b91a334 100755
> --- a/configure
> +++ b/configure
> @@ -7080,4 +7080,4 @@ done
>  echo ' "$@"' >>config.status
>  chmod +x config.status
>
> -rm -r "$TMPDIR1"
> +rm -rf "$TMPDIR1"

We rm -rf this directory at the top of configure, so it seems
like an oversight that we don't use '-f' here at the bottom too.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

You should probably look into why your compiler is generating
write-protected .o files, though -- that doesn't sound normal.

thanks
-- PMM