]> arthur.barton.de Git - bup.git/commitdiff
GNUmakefile: clean mounts earlier to avoid later crashes
authorRob Browning <rlb@defaultvalue.org>
Sat, 27 Nov 2021 19:38:51 +0000 (13:38 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 4 Dec 2021 17:25:26 +0000 (11:25 -0600)
Otherwise lingering mounts with unexpected/broken content (e.g. fuse)
can cause find, etc. to crash.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
GNUmakefile

index 83d141da96f1e38741777b5003a17f94b28673d2..61d4a4c5a7c6f66145af8b8942538123661e270f 100644 (file)
@@ -285,11 +285,8 @@ import-docs: Documentation/clean
 
 clean: Documentation/clean
        cd config && rm -rf finished bin config.var
-       cd config && rm -f \
-         ${CONFIGURE_DETRITUS} ${CONFIGURE_FILES} ${GENERATED_FILES}
-       rm -rf $(clean_paths) .pytest_cache
-       rm -f $(generated_dependencies)
-       find . -name __pycache__ -exec rm -rf {} +
+
+        # Clean up the mounts first, so that find, etc. won't crash later
        if test -e test/mnt; then dev/cleanup-mounts-under test/mnt; fi
        if test -e test/mnt; then rm -r test/mnt; fi
        if test -e test/tmp; then dev/cleanup-mounts-under test/tmp; fi
@@ -297,5 +294,11 @@ clean: Documentation/clean
        if test -e test/int/testfs; \
          then umount test/int/testfs || true; fi
        rm -rf test/int/testfs test/int/testfs.img testfs.img
+
+       cd config && rm -f \
+         ${CONFIGURE_DETRITUS} ${CONFIGURE_FILES} ${GENERATED_FILES}
+       rm -rf $(clean_paths) .pytest_cache
+       rm -f $(generated_dependencies)
+       find . -name __pycache__ -exec rm -rf {} +
        if test -e test/tmp; then dev/force-delete test/tmp; fi
        dev/configure-sampledata --clean