Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "João Marcos Costa" <joaomarcos.costa@bootlin.com>
To: openembedded-core@lists.openembedded.org
Cc: thomas.petazzoni@bootlin.com, paul@pbarker.dev,
	yoann.congal@smile.fr,
	"João Marcos Costa" <joaomarcos.costa@bootlin.com>
Subject: [PATCH v2 RESEND] classes/archiver: fix tarball content in "original" mode
Date: Fri, 18 Sep 2026 11:27:11 +0200	[thread overview]
Message-ID: <20260918092711.471982-1-joaomarcos.costa@bootlin.com> (raw)

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 pointing to the subdir where the sources are
unpacked, rather than to tmpdir, when calling create_tarball().

The subdir's name can be inferred from 'BP', so we will use
'tmp8pu2nsck/vim-9.2.0340/.' instead of 'tmp8pu2nsck/.' as input.

e.g. and in the result:

./
./vim-9.2.0304/
./vim-9.2.0304/SECURITY.md
./vim-9.2.0304/.codecov.yml
(...)

Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
---
 meta/classes/archiver.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index b274c53e79..c824718a1d 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -230,7 +230,7 @@ python do_ar_original() {
                     else:
                         bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
             tarball_suffix[name] = url
-            create_tarball(d, tmpdir + '/.', name, ar_outdir)
+            create_tarball(d, os.path.join(tmpdir, d.getVar('BP'), '.'), name, ar_outdir)
 
     # Emit patch series files for 'original'
     bb.note('Writing patch series files...')
-- 
2.55.0



                 reply	other threads:[~2026-09-18  9:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260918092711.471982-1-joaomarcos.costa@bootlin.com \
    --to=joaomarcos.costa@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul@pbarker.dev \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yoann.congal@smile.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox