[Buildroot] [PATCH 1/1] fs/tar: support passing long options to tar

Frank Hunleth fhunleth at troodon-software.com
Mon Jun 20 23:18:09 UTC 2016


This change modifies how options are passed to tar to support long
options. Unfortunately, it breaks configurations that previously used
this feature. Before the change, options were passed using the
single-letter without a '-' form. E.g., if the user wanted to turn on
verbose output, they would have to specify 'v'. With this change, the
user would need to pass '-v'. The help text is updated to make the
requirement more clear.

Signed-off-by: Frank Hunleth <fhunleth at troodon-software.com>
---
 fs/tar/Config.in | 5 +++--
 fs/tar/tar.mk    | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/tar/Config.in b/fs/tar/Config.in
index 63663ec..14fc7a4 100644
--- a/fs/tar/Config.in
+++ b/fs/tar/Config.in
@@ -48,5 +48,6 @@ config BR2_TARGET_ROOTFS_TAR_OPTIONS
 	depends on BR2_TARGET_ROOTFS_TAR
 	default ""
 	help
-	  Any other flags you want to pass to tar
-	  Refer to tar --help for details
+	  Pass additional commandline arguments to tar. Use the '-' or '--'
+	  forms of options rather than the single-letter combining forms.
+	  Refer to tar --help for details.
diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk
index 28219cf..d598f52 100644
--- a/fs/tar/tar.mk
+++ b/fs/tar/tar.mk
@@ -7,7 +7,7 @@
 TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS))
 
 define ROOTFS_TAR_CMD
-	tar -c$(TAR_OPTS)f $@ --numeric-owner -C $(TARGET_DIR) .
+	tar -c $(TAR_OPTS) -f $@ --numeric-owner -C $(TARGET_DIR) .
 endef
 
 $(eval $(call ROOTFS_TARGET,tar))
-- 
2.5.0



More information about the buildroot mailing list