fs/tar: make --no-recursion effective
PATCH 1/1 fs/tar: make --no-recursion effective
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.
--- fs/tar/tar.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/tar/tar.mk +1 -1
@@ -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))
Signature · 1 line
2.11.0
PATCH 1/1 fs/tar: make --no-recursion effective
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Baruch" == Baruch Siach <[email protected]> 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 <[email protected]>
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!
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 fs/tar: make --no-recursion effective
Hi Peter,
Quoted 7 lines · Peter Korsgaard
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Baruch" == Baruch Siach <[email protected]> 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.
Quoted 6 lines
Quoted 1 line
Signed-off-by Baruch Siach <[email protected]>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
Quoted 2 lines
But indeed, tar -tvf output/images/rootfs.tar | grep '
/usr/$' had 2 hits before, and not after applying this patch - So committed, thanks!
baruch
Signature · 3 lines
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 -PATCH 1/1 fs/tar: make --no-recursion effective
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Baruch" == Baruch Siach <[email protected]> writes:
Hi,
Quoted 11 lines
Quoted 4 lines
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.
Signature · 1 line
Bye, Peter Korsgaard