On Tue, Apr 05, 2022 at 09:48:20PM +0800, Guo Zhi wrote: > If this patch is applied, issue: > > https://gitlab.com/qemu-project/qemu/-/issues/321 > > can be closed. > > Signed-off-by: Guo Zhi <qtxuning1...@sjtu.edu.cn> > --- > configure | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index 7c08c18358..9cfa78efd2 100755 > --- a/configure > +++ b/configure > @@ -24,7 +24,13 @@ then > then > if test -f $MARKER > then > - rm -rf build > + if test -w $MARKER > + then > + rm -rf build > + else > + echo "ERROR: ./build dir already exists and can not be > removed due to permission" > + exit 1 > + fi
Other cases where "rm -rf build" fails are ignored. The script will keep running and produce confusing output. Maybe the script should check if rm(1) failed so that all possible cases where the build directory is broken produce reasonable error messages? Then there is also no need to check $MARKER explicitly. Stefan
signature.asc
Description: PGP signature