@@ -424,7 +424,12 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
bb.note('Creating %s' % tarname)
dirname = os.path.dirname(srcdir)
basename = os.path.basename(srcdir)
- tar_cmd = ["tar", "--exclude=temp", "--exclude=patches", "--exclude=.pc", '-cf', tarname, basename, '-I', compression_cmd]
+ if d.getVarFlag('ARCHIVER_MODE', 'src') == "original":
+ tar_dir, content = srcdir, "."
+ else:
+ tar_dir, content = dirname, basename
+
+ tar_cmd = ["tar", "--exclude=temp", "--exclude=patches", "--exclude=.pc", '-C', tar_dir, '-cf', tarname, content, '-I', compression_cmd]
subprocess.check_call(tar_cmd, cwd=dirname)
# creating .diff.gz between source.orig and source
When ARCHIVER_MODE[src] is set to "original", a tarball is generated with the unpacked sources of a given recipe. Prior to it, a tmpdir (i.e. from tempfile.mkdtemp()) is created and the sources are unpacked inside: (...)/vim/9.2.0340/archiver-work/tmp8pu2nsck `-- vim-9.2.0340 |-- READMEdir |-- ci |-- lang This tmpdir, however, ends up being shipped in the deployed tarball: $ tar -tf vim-9.2.0340-r0.tar.xz (...) tmp8pu2nsck/vim-9.2.0340/ci/config.mk.clang-12.sed tmp8pu2nsck/vim-9.2.0340/LICENSE tmp8pu2nsck/vim-9.2.0340/.git-blame-ignore-revs (...) This can be avoided by using "-C" option from tar's command, with which we can point to the tmpdir and to the content inside separately: tar --exclude=temp --exclude=patches --exclude='.pc' \ -C (...)/vim/9.1.1683/archiver-work/tmpv0m93p52 -cf - . | \ xz --memlimit=50% --threads=64 > \ (...)/vim/9.1.1683/archiver-sources/(...)/vim-9.1.1683-r0/vim-9.1.1683-r0.tar.xz and in the result: ./ ./vim-9.1.1683/ ./vim-9.1.1683/SECURITY.md ./vim-9.1.1683/.codecov.yml (...) Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com> --- meta/classes/archiver.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)