Skip to contentSkip to conversation

auto remove empty /usr/share dir

PATCH New Mike Frysinger 3 participants 3 messages Nov 18, 2010 – Nov 24, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auto remove empty /usr/share dir

Often times, the only reason /usr/share exists is because of documentation installed into it. So once we're done cleaning the docs, attempt to rmdir /usr/share. If it's empty, things will work out nicely.

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index 69e4031..4cc62e9 100644
@@ -403,6 +403,7 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
 	rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
 	rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
 	rm -rf $(TARGET_DIR)/usr/share/gtk-doc
+	rmdir $(TARGET_DIR)/usr/share 2>/dev/null || :
 endif
 	find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
 	find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/1 auto remove empty /usr/share dir

Quoted 5 lines · On Thu, 18 Nov 2010 16:25:58 -0500 Mike Frysinger <[email protected]> wrote:

Often times, the only reason /usr/share exists is because of documentation installed into it. So once we're done cleaning the docs, attempt to rmdir /usr/share. If it's empty, things will work out nicely.

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 auto remove empty /usr/share dir

In reply to Mike Frysinger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Mike" == Mike Frysinger <[email protected]> writes:

Mike> Often times, the only reason /usr/share exists is because of Mike> documentation installed into it. So once we're done cleaning the Mike> docs, attempt to rmdir /usr/share. If it's empty, things will Mike> work out nicely.

Committed, thanks. I prefer to tell make to simply ignore the return value rather than the '|| :' shell code though.

Signature · 1 line
Bye, Peter Korsgaard