mbox series

[v4,0/2] archiver.bbclass: archive shallow git sources without a clone, drop .git

Message ID 20261202205446.2442999-1-ecordonnier@snap.com
Headers show
Series archiver.bbclass: archive shallow git sources without a clone, drop .git | expand

Message

Etienne Cordonnier Dec. 2, 2026, 8:54 p.m. UTC
From: Etienne Cordonnier <ecordonnier@snap.com>

In "original" mode, a git source fetched through a shallow tarball (fast
initial shallow fetch, or a tarball from a mirror) has no clone in DL_DIR, so
do_ar_original silently skipped it. This series archives it, and removes the
useless .git from the archives of git sources.

Etienne Cordonnier (2):
  archiver.bbclass: unpack original sources without a localpath
  archiver.bbclass: remove .git from original git source archives

v4:
  - Follow Paul's review of v3: no fetcher-specific code in do_ar_original.
    A source is copied if localpath() is a file, otherwise it is unpacked
    with fetch.unpack() and it is an error if nothing was unpacked.
  - Drop the bitbake patch from v3 (return the shallow tarball as
    localpath): with the above, the archiver no longer depends on
    localpath() existing for git.
  - Fold the "fail on sources which cannot be archived" patch into 1/2.
  - Add selftests for plain git, gitsm and nocheckout.

v3:
  - Add a bitbake patch so localpath() exists after do_fetch when the shallow
    tarball is used without a clone, as suggested in the v2 review, and drop
    the shallow special case from the archiver.

v2:
  - Combined the two v1 patches into one series, as requested.
  - Split "archive shallow git sources which have no clone" into 1/3 (archive
    the shallow source) and 2/3 (remove .git), and 2/3 now removes .git for
    all git sources, including the .git files of submodules (kept for
    nocheckout/bareclone).
  - 3/3 ("warn about sources which are not archived" in v1) now raises a
    fatal error.


 meta/classes/archiver.bbclass            |  23 ++++-
 meta/lib/oeqa/selftest/cases/archiver.py | 111 +++++++++++++++++++++++
 2 files changed, 131 insertions(+), 3 deletions(-)


base-commit: 4b4fc6d149e030f8d2d60f6a4e44a44d56cb8082