Karl Berry wrote: > I find that make clean fails for me in texinfo's gnulib, because my > gnulib/lib/sys/ directory is not empty, just because it contains a CVS dir: > > $ make clean > ... > make[1]: Entering directory `/u/karl/gnu/src/texinfo/gnulib/lib' > test -z "" || rm -f > test -z "libgnu.a" || rm -f libgnu.a > test -z "" || rm -f > rm -f *.o > test -z "core *.stackdump alloca.h alloca.h-t getopt.h getopt.h-t stdint.h > stdint.h-t stdlib.h stdlib.h-t string.h string.h-t sys/stat.h sys/stat.h-t > sys/time.h sys/time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h > wctype.h-t" || rm -f core *.stackdump alloca.h alloca.h-t getopt.h getopt.h-t > stdint.h stdint.h-t stdlib.h stdlib.h-t string.h string.h-t sys/stat.h > sys/stat.h-t sys/time.h sys/time.h-t unistd.h unistd.h-t wchar.h wchar.h-t > wctype.h wctype.h-t > rmdir sys > rmdir: sys: Directory not empty > make[1]: *** [mostlyclean-local] Error 1 > $ ls gnulib/lib/sys > CVS/ > > I think this is coming from this line in gnulib-tool (1444 or so): > > echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
Indeed. The exit code of the 'for' loop around it appears to be the exit code of the last rmdir command. The patch below should fix it. > ? That leaves the diagnostic but lets things continue. It seems pretty > harmless to me if the rmdir fails. And, moreover, the exit code of rmdir of all subdirectories except the last one are already ignored. 2007-06-23 Bruno Haible <[EMAIL PROTECTED]> * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Don't let the 'mostlyclean' target fail if the last subdirectory could not be removed. Reported by Karl Berry. --- gnulib-tool 23 Jun 2007 12:37:29 -0000 1.240 +++ gnulib-tool 23 Jun 2007 19:17:35 -0000 @@ -1500,7 +1500,8 @@ echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\" echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" echo " fi; \\" - echo " done" + echo " done; \\" + echo " :" rm -f allsnippets.tmp } @@ -1615,7 +1616,8 @@ echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\" echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" echo " fi; \\" - echo " done" + echo " done; \\" + echo " :" rm -f allsnippets.tmp }