Bug 9763

Summary: tar --exclude option is position-sensitive
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Andreas Fenkart <afenkart>
Component: coreAssignee: Mariano Lopez <mariano.lopez>
Status: RESOLVED FIXED QA Contact: David Rodriguez <david.israelx.rodriguez.castellanos>
Severity: normal    
Priority: Medium+ CC: jose.perez.carranza, meta.mr.watcher, meta.watcher
Version: unspecified   
Target Milestone: 2.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Andreas Fenkart 2016-06-13 11:28:12 UTC
http://lists.gnu.org/archive/html/bug-tar/2016-05/msg00022.html

This issue has been fixed for perl-ptest.inc in commit

2e498879098f7d84610aed7961d92433083d9a02
With tar version 1.29, the tar call used to copy the ptest files will
not work anymore. While the call did not match the man page (but worked)
before, anyway, the latest update of tar seems to have a more strict argument
handling.


But a grep over openmbedded-core/2fdd2c143 reveals other recipes still
suffer from that problem:

./meta/recipes-support/attr/acl.inc:37:	tar -cf - test/ --exclude nfs
./meta/recipes-support/attr/attr.inc:29:	tar -cf - test/ --exclude ext 
./meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch:57:+	cd $(BUILDDIR); tar -cf - $(TESTDIR) --exclude *.o | ( cd $(DESTDIR) && tar -xf - )

exclude=generate_uudmap --exclude=patches * | ( cd ${D}${PTEST_PATH} && tar -x )
./meta/recipes-devtools/quilt/quilt.inc:51:	tar -cf - bin/ --exclude \*.in..
./meta/recipes-devtools/quilt/quilt.inc:52:	tar -cf - compat/ --exclude \*.in..
./meta/recipes-devtools/quilt/quilt.inc:53:	tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
./meta/recipes-devtools/quilt/quilt.inc:54:	tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
Comment 1 Leonardo Sandoval Gonzalez 2016-06-16 15:54:44 UTC
The poky related commit is 5efe4c9a64afe4b5489f1b95d9ade22768841da6
Comment 2 Mariano Lopez 2016-08-04 21:17:10 UTC
Files possible affected in bitbake are:

bitbake/lib/bb/fetch2/bzr.py:   tar_flags = "--exclude '.bzr' --exclude '.bzrtags'"
bitbake/lib/bb/fetch2/cvs.py:   tar_flags = "--exclude 'CVS'"
bitbake/lib/bb/fetch2/repo.py:  tar_flags = "--exclude '.repo' --exclude '.git'"
bitbake/lib/bb/fetch2/svn.py:   tar_flags = "--exclude '.svn'"

Files affected in OE-Core are:

meta/recipes-devtools/quilt/quilt.inc:  tar -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
meta/recipes-devtools/quilt/quilt.inc:  tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
meta/recipes-devtools/quilt/quilt.inc:  tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
meta/recipes-devtools/quilt/quilt.inc:  tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch:+       cd $(BUILDDIR); tar -cf - $(TESTDIR) --exclude *.o | ( cd $(DESTDIR) && tar -xf - )
meta/recipes-support/attr/acl.inc:      tar -cf - test/ --exclude nfs | ( cd ${D}${PTEST_PATH} && tar -xf - )
meta/recipes-support/attr/attr.inc:     tar -cf - test/ --exclude ext | ( cd ${D}${PTEST_PATH} && tar -xf - )