Skip to contentSkip to conversation

blkid/Makefile.in: ignore rmdir non-empty dir error

PATCH In review Peng Tao 2 participants 3 messages Sep 28, 2009 – Oct 4, 2009

lore
Share & tools
lore

Peng Tao

author
#0 lore raw

PATCH 1/1 blkid/Makefile.in: ignore rmdir non-empty dir error

Otherwise, make clean returns the following error, which is missleading. rmdir tests
rmdir: failed to remove `tests': Directory not empty
make: [clean] Error 1 (ignored)

---
 lib/blkid/Makefile.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/blkid/Makefile.in +1 -1
index 9169226..618c0b2 100644
@@ -181,7 +181,7 @@ clean::
 		tests/*.img results test_probe core profiled/* \
 		checker/* blkid_types.h ../libblkid.a ../libblkid_p.a \
 		$(SMANPAGES) blkid
-	-rmdir tests
+	-rmdir --ignore-fail-on-non-empty tests
 
 mostlyclean:: clean
 distclean:: clean
Signature · 1 line
1.6.5.rc2.262.g5224f
#1 lore raw

lib/blkid/Makefile.in clean:: · line 184

Quoted 5 lines · Peng Tao
lib/blkid/Makefile.in +1 -1
 		checker/* blkid_types.h ../libblkid.a ../libblkid_p.a \
 		$(SMANPAGES) blkid
-	-rmdir tests
+	-rmdir --ignore-fail-on-non-empty tests

Sorry, NACK. This will blow up on systems that aren't using the GNU shellutils. The error is ignored, which is good enough. We can do something like this instead:

@echo rmdir tests/tmp tests
-@rmdir tests/tmp tests >& /dev/null

If we really care, I suppose.

- Ted

#2 lore raw
In reply to Peng Tao
Quoted 6 lines · Peng Tao

Otherwise, make clean returns the following error, which is missleading. rmdir tests
rmdir: failed to remove `tests': Directory not empty
make: [clean] Error 1 (ignored)

This is what I checked in instead.

- Ted

commit 7822f784f1edf767cc74044e02702a6d44cee267

Author: Theodore Ts'o <[email protected]>
Date:   Sat Oct 3 22:33:47 2009 -0400

blkid: Avoid a potentially error message when running "make clean"

This error isn't terribly important, but apparently it causes some users/developers distress.

lib/blkid/Makefile.in +2 -1
index 9169226..9339718 100644
@@ -181,7 +181,8 @@ clean::
 		tests/*.img results test_probe core profiled/* \
 		checker/* blkid_types.h ../libblkid.a ../libblkid_p.a \
 		$(SMANPAGES) blkid
-	-rmdir tests
+	@echo rmdir tests/tmp tests
+	@(rmdir tests/tmp tests 2> /dev/null ; exit 0)
 
 mostlyclean:: clean
 distclean:: clean