diff mbox

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

Message ID 1363177697-31728-1-git-send-email-ezequiel.garcia@free-electrons.com
State Accepted
Commit 402d1476f7159ab8055ec8b811b4fb5cd78b5609
Headers show

Commit Message

Ezequiel Garcia March 13, 2013, 12:28 p.m. UTC
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.

Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>
---
 fs/common.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Arnout Vandecappelle March 13, 2013, 8:48 p.m. UTC | #1
On 03/13/13 13:28, Ezequiel Garcia wrote:
> 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.
>
> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> Signed-off-by: Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

(visual inspection only)


  Regards,
  Arnout

> ---
>   fs/common.mk |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/common.mk b/fs/common.mk
> index 8b5b2f2..a0b7b39 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -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
>
>
Peter Korsgaard March 13, 2013, 10:13 p.m. UTC | #2
>>>>> "Ezequiel" == Ezequiel Garcia <ezequiel.garcia@free-electrons.com> 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.
diff mbox

Patch

diff --git a/fs/common.mk b/fs/common.mk
index 8b5b2f2..a0b7b39 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -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