Skip to contentSkip to conversation

fs/common.mk: Strip extra whitespace when device table is empty

PATCH New Ezequiel Garcia 3 participants 4 messages Mar 13, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/common.mk: Strip extra whitespace when device table is empty

Since ROOTFS_DEVICE_TABLES it is a concatenation of two strings separated by spaces, there will always be a space on it, which means it's never empty. Therefore, when testing for empty, the condition never evaluate to false.

The following change fixes this problem; it runs the qstrip on the overall combination of the variables, causing the space to be removed if it's the only thing left.

---
 fs/common.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/common.mk +2 -2
index 8b5b2f2..a0b7b39 100644
@@ -33,8 +33,8 @@
 
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
-ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
-	$(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
+ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
+       $(BR2_ROOTFS_STATIC_DEVICE_TABLE))
 
 define ROOTFS_TARGET_INTERNAL
 
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 1/1 fs/common.mk: Strip extra whitespace when device table is empty

Since ROOTFS_DEVICE_TABLES it is a concatenation of two strings separated by spaces, there will always be a space on it, which means it's never empty. Therefore, when testing for empty, the condition never evaluate to false.

The following change fixes this problem; it runs the qstrip on the overall combination of the variables, causing the space to be removed if it's the only thing left.

---
 fs/common.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/common.mk +2 -2
index 8b5b2f2..a0b7b39 100644
@@ -33,8 +33,8 @@
 
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
-ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
-	$(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
+ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
+       $(BR2_ROOTFS_STATIC_DEVICE_TABLE))
 
 define ROOTFS_TARGET_INTERNAL
 
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 1/1 fs/common.mk: Strip extra whitespace when device table is empty

In reply to Ezequiel Garcia
Quoted 11 lines · Ezequiel Garcia

Since ROOTFS_DEVICE_TABLES it is a concatenation of two strings separated by spaces, there will always be a space on it, which means it's never empty. Therefore, when testing for empty, the condition never evaluate to false.

The following change fixes this problem; it runs the qstrip on the overall combination of the variables, causing the space to be removed if it's the only thing left.

(visual inspection only)

Regards,
Arnout

Quoted 20 lines
---
  fs/common.mk |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
fs/common.mk +2 -2
index 8b5b2f2..a0b7b39 100644
@@ -33,8 +33,8 @@
 
  FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
  FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
-ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE)) \
-	$(call qstrip,$(BR2_ROOTFS_STATIC_DEVICE_TABLE))
+ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
+       $(BR2_ROOTFS_STATIC_DEVICE_TABLE))
 
  define ROOTFS_TARGET_INTERNAL
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/1 fs/common.mk: Strip extra whitespace when device table is empty

In reply to Ezequiel Garcia
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ezequiel" == Ezequiel Garcia <[email protected]> writes:

Ezequiel> Since ROOTFS_DEVICE_TABLES it is a concatenation of two strings Ezequiel> separated by spaces, there will always be a space on it, which means Ezequiel> it's never empty. Therefore, when testing for empty, the condition Ezequiel> never evaluate to false.

Ezequiel> The following change fixes this problem; it runs the qstrip on Ezequiel> the overall combination of the variables, causing the space to be Ezequiel> removed if it's the only thing left.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard