All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] fs/tar: make --no-recursion effective
@ 2016-12-27 17:42 Baruch Siach
  2016-12-28  9:21 ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2016-12-27 17:42 UTC (permalink / raw)
  To: buildroot

The tar --no-recursion option is position sensitive. It only affects following
file listing options. Move --no-recursion before the -T option to make it
effective. This fixes duplication of entries in the generated rootfs.tar
archive.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 fs/tar/tar.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk
index b14c977d761c..0e3eacbedf05 100644
--- a/fs/tar/tar.mk
+++ b/fs/tar/tar.mk
@@ -8,7 +8,7 @@ TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS))
 
 define ROOTFS_TAR_CMD
 	(cd $(TARGET_DIR); find -print0 | LC_ALL=C sort -z | \
-		tar $(TAR_OPTS) -cf $@ --null -T - --no-recursion --numeric-owner)
+		tar $(TAR_OPTS) -cf $@ --null --no-recursion -T - --numeric-owner)
 endef
 
 $(eval $(call ROOTFS_TARGET,tar))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] fs/tar: make --no-recursion effective
  2016-12-27 17:42 [Buildroot] [PATCH] fs/tar: make --no-recursion effective Baruch Siach
@ 2016-12-28  9:21 ` Peter Korsgaard
  2016-12-28  9:32   ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2016-12-28  9:21 UTC (permalink / raw)
  To: buildroot

>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

 > The tar --no-recursion option is position sensitive. It only affects following
 > file listing options. Move --no-recursion before the -T option to make it
 > effective. This fixes duplication of entries in the generated rootfs.tar
 > archive.

 > Signed-off-by: Baruch Siach <baruch@tkos.co.il>

I got a bit confused by this, as the manual explicitly shows the -T -
--no-recursion sequence:

https://www.gnu.org/software/tar/manual/html_section/tar_54.html

But indeed, tar -tvf output/images/rootfs.tar | grep '/usr/$' had 2 hits
before, and not after applying this patch - So committed, thanks!

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] fs/tar: make --no-recursion effective
  2016-12-28  9:21 ` Peter Korsgaard
@ 2016-12-28  9:32   ` Baruch Siach
  2016-12-28 10:19     ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2016-12-28  9:32 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Wed, Dec 28, 2016 at 10:21:26AM +0100, Peter Korsgaard wrote:
> >>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
> 
>  > The tar --no-recursion option is position sensitive. It only affects following
>  > file listing options. Move --no-recursion before the -T option to make it
>  > effective. This fixes duplication of entries in the generated rootfs.tar
>  > archive.
> 
>  > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> I got a bit confused by this, as the manual explicitly shows the -T -
> --no-recursion sequence:
> 
> https://www.gnu.org/software/tar/manual/html_section/tar_54.html

That part of the tar manual looks wrong. The "Position-Sensitive Options"[1] 
section shows this example to illustrate the position sensitivity concept:

  tar -cf a.tar --recursion /usr --no-recursion /var/*

[1] https://www.gnu.org/software/tar/manual/html_section/tar_22.html#SEC44

> But indeed, tar -tvf output/images/rootfs.tar | grep '/usr/$' had 2 hits
> before, and not after applying this patch - So committed, thanks!

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] fs/tar: make --no-recursion effective
  2016-12-28  9:32   ` Baruch Siach
@ 2016-12-28 10:19     ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2016-12-28 10:19 UTC (permalink / raw)
  To: buildroot

>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

Hi,

 >> I got a bit confused by this, as the manual explicitly shows the -T -
 >> --no-recursion sequence:
 >> 
 >> https://www.gnu.org/software/tar/manual/html_section/tar_54.html

 > That part of the tar manual looks wrong. The "Position-Sensitive Options"[1] 
 > section shows this example to illustrate the position sensitivity concept:

 >   tar -cf a.tar --recursion /usr --no-recursion /var/*

 > [1] https://www.gnu.org/software/tar/manual/html_section/tar_22.html#SEC44

Ahh, ok - Thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-28 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 17:42 [Buildroot] [PATCH] fs/tar: make --no-recursion effective Baruch Siach
2016-12-28  9:21 ` Peter Korsgaard
2016-12-28  9:32   ` Baruch Siach
2016-12-28 10:19     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.