Skip to contentSkip to conversation

Ignore errors on rmdir in clean-targets

PATCH New Michel Wilson 2 participants 2 messages Sep 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Ignore errors on rmdir in clean-targets

Hi,

When doing a make clean, make bombed out with an rmdir error in dbus-clean; apparently $(TARGET_DIR)/usr/include was already removed. This is obviously no problem in clean-targets, so I grepped the Makefiles for this problem. Below a patch which removes errorchecking on all rmdir calls in clean-targets. Inline this time, hopefully KMail is not a 'broken mailer' in this regard.

Regards,

Michel Wilson.

jffs2/jffs2root.mk +1 -1
Index: target/jffs2/jffs2root.mk
===================================================================
@@ -58,7 +58,7 @@
 ifneq ($(BR2_HAVE_INFOPAGES),y)
 	@rm -rf $(TARGET_DIR)/usr/info
 endif
-	@rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
+	@-rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
 	$(if $(TARGET_LDCONFIG),test -x $(TARGET_LDCONFIG) && $(TARGET_LDCONFIG) -r 

$(TARGET_DIR) 2>/dev/null)
# Use fakeroot to pretend all target binaries are owned by root rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(JFFS2_TARGET))

cloop/cloop.mk +1 -1
Index: target/cloop/cloop.mk
===================================================================
@@ -71,7 +71,7 @@
 	@rm -rf $(TARGET_DIR)/usr/info
 	@rm -rf $(TARGET_DIR)/usr/share/info
 endif
-	@rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
+	@-rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
 	which mkisofs
 	- at find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || 

true
- which symlinks && symlinks -r $(TARGET_DIR)

dbus/dbus.mk +2 -2
Index: package/dbus/dbus.mk
===================================================================
@@ -92,7 +92,7 @@
 dbus-clean:
 	rm -f $(TARGET_DIR)/etc/dbus-1/session.conf
 	rm -f $(TARGET_DIR)/etc/dbus-1/system.conf
-	rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/etc/dbus-1/system.d
+	-rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/etc/dbus-1/system.d
 	rm -f $(TARGET_DIR)/etc/init.d/S30dbus
 	rm -f $(TARGET_DIR)/usr/lib/libdbus-1.so*
 	rm -f $(TARGET_DIR)/usr/bin/dbus-daemon
@@ -100,7 +100,7 @@
 	rm -f $(STAGING_DIR)/usr/lib/libdbus-1.*
 	rm -rf $(STAGING_DIR)/usr/lib/dbus-1.0
 	rm -rf $(STAGING_DIR)/usr/include/dbus-1.0
-	rmdir --ignore-fail-on-non-empty $(STAGING_DIR)/usr/include
+	-rmdir --ignore-fail-on-non-empty $(STAGING_DIR)/usr/include
 	-$(MAKE) -C $(DBUS_DIR) clean
 
 dbus-dirclean:
bind/bind.mk +1 -1
Index: package/bind/bind.mk
===================================================================
@@ -61,7 +61,7 @@
 $(TARGET_DIR)/$(BIND_TARGET_BINARY): $(BIND_DIR2)/$(BIND_BINARY)
 	$(MAKE) $(TARGET_CONFIGURE_OPTS) -j1 MAKEDEFS="INSTALL_DATA=true" \
 		DESTDIR=$(TARGET_DIR) -C $(BIND_DIR2)/bin install
-	cd $(TARGET_DIR)/usr/man; rmdir --ignore-fail-on-non-empty man8 man5 `pwd`
+	-cd $(TARGET_DIR)/usr/man; rmdir --ignore-fail-on-non-empty man8 man5 `pwd`
 	$(INSTALL) -m 0755 -D package/bind/bind.sysvinit 

$(TARGET_DIR)/etc/init.d/S81named

bind-bin: $(TARGET_DIR)/$(BIND_TARGET_BINARY) bind-lib

tinyhttpd/tinyhttpd.mk +1 -1
Index: package/tinyhttpd/tinyhttpd.mk
===================================================================
@@ -41,7 +41,7 @@
 	-$(MAKE) -C $(TINYHTTPD_DIR) clean
 	@rm -f $(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY)
 	@rm -f $(TARGET_DIR)/etc/init.d/S85tinyhttpd
-	@rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/var/www
+	@-rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/var/www
 
 tinyhttpd-dirclean:
 	rm -rf $(TINYHTTPD_DIR)
usbutils/usbutils.mk +1 -1
Index: package/usbutils/usbutils.mk
===================================================================
@@ -46,7 +46,7 @@
 usbutils-clean:
 	rm -f $(TARGET_DIR)/$(USBUTILS_TARGET_BINARY)
 	rm -f $(TARGET_DIR)/usr/share/usb.ids
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
+	-rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
 	-$(MAKE) -C $(USBUTILS_DIR) clean
 
 usbutils-dirclean:
udev/udev.mk +2 -2
Index: package/udev/udev.mk
===================================================================
@@ -110,7 +110,7 @@
 	rm -f $(STAGING_DIR)/usr/lib/libvolume_id.la
 	rm -f $(TARGET_DIR)/usr/lib/libvolume_id.so.0*
 	rm -f $(TARGET_DIR)/lib/udev/vol_id
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
+	-rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
 
 udev-volume_id-dirclean:
 	-$(MAKE) EXTRAS="extras/volume_id" -C $(UDEV_DIR) clean
@@ -142,7 +142,7 @@
 udev-scsi_id-clean:
 	rm -f $(TARGET_DIR)/lib/udev/scsi_id
 	rm -f $(TARGET_DIR)/lib/udev/usb_id
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
+	-rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/lib/udev
 
 udev-scsi_id-dirclean:
 	-$(MAKE) EXTRAS="extras/scsi_id" -C $(UDEV_DIR) clean
hwdata/hwdata.mk +1 -1
Index: package/hwdata/hwdata.mk
===================================================================
@@ -35,7 +35,7 @@
 
 hwdata-clean:
 	rm -rf $(TARGET_DIR)/usr/share/hwdata
-	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
+	-rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
 
 hwdata-dirclean:
 	rm -rf $(HWDATA_DIR)
hal/hal.mk +1 -1
Index: package/hal/hal.mk
===================================================================
@@ -99,7 +99,7 @@
 	rm -f $(TARGET_DIR)/usr/bin/hal-* $(TARGET_DIR)/usr/bin/lshal
 	rm -f $(TARGET_DIR)/usr/sbin/hald
 	rm -f $(TARGET_DIR)/usr/libexec/hald-* $(TARGET_DIR)/usr/libexec/hal-*
-	rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/libexec
+	-rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/libexec
 	rm -f $(TARGET_DIR)/usr/lib/libhal.so.1*
 	rm -f $(TARGET_DIR)/usr/lib/libhal-storage.so.1*
 	-$(MAKE) -C $(HAL_DIR) clean

Signature · 2 lines
Michel Wilson     michel at crondor.net
PGP key ID        0xD2CB4B7E
#1 lore raw

PATCH 1/1 Ignore errors on rmdir in clean-targets

Michel Wilson, 08.09.2008:

Quoted 1 line

Inline this time, hopefully KMail is not a 'broken mailer' in this regard.

The patch is malformed, it contains some wrapped lines. The same for your "disable cursor in X" patch.

I use KMail, too. But because of inline patches and text formatting, I use gvim as mail editor. You have to disable the line length (default 78) then. My setting is: gvim -f --cmd "set tw=78" %f
Then you have the limited line length with text formatting and can add patches by pasting or reading in with :r

You can disable the line length without using an external editor and the patch should arrive find, but then you loose the automatic text formatting of KMail. You cannot have both at once.

There is also a trick, but I don't think the usage is widespread. See the file Documentation/email-clients.txt in the Linux source tree.

Markus