mbox series

[0/9] everywhere: use $(TAR) not tar (branch yem/tarTAR)

Message ID cover.1717597094.git.yann.morin.1998@free.fr
Headers show
Series everywhere: use $(TAR) not tar (branch yem/tarTAR) | expand

Message

Yann E. MORIN June 5, 2024, 2:18 p.m. UTC
Hello All!

To allow for reproducible archives, and to ensure we can extract all
archives, we require that we use tar 1.35 or above.

There are then two cases:
 1. the system has a suitable tar: we use that;
 2. the system has no suitable tar: we build our own host-tar, and use
    that (it ends up in HOST_DIR/bin so is in the PATH).

However, to avoid building host-tar again and again, people can set the
TAR environment variable, to point to a tar version they believe is
suitable (if it is not, we fallback to case 2, above). If the user
provides a suitable tar, then we do not build our own host-tar and use
the one provided by the user.

However, there are a few places where we do hard-code calls to 'tar'
without considering the one provided by the user. This breaks cases
where an unsuitable tar is available on the system, as that unsuitable
tar is then used to create and extract tarballs. This breaks generatign
tarballs from VCS (git, svn) or from vendoring (cargo, go).

Fix all those cases.

How to find calls to tar:

    $ git grep -E '\<tar '

There are a lot of false positive:
  - CHANGES
  - comments
  - docs
  - patches
  - misc (e.g. a script with a $tar variable)

After this series, we still have a very few locations which directly
call to a plain tar:
  - Makefile: the 'release' target
  - scripts not called as part of the build
  - boards readmes
  - patches

The first will be addressed in a separate patch, as it is not critical
(users do not nromally cut Buildroot releases!). The others can't be
changed, as they execute outside Buildroot's control.

Regards,
Yann E. MORIN.


----------------------------------------------------------------
Yann E. MORIN (9):
      fs/tar: use appropriate TAR
      package/cvs: use appropriate TAR
      package/flutter-engine: use appropriate TAR
      package/pkg-download: export TAR for download backends
      support/download/helpers: use appropriate TAR
      support/download/cvs: fix shellcheck
      support/download/cvs: use appropriate TAR
      support/scripts/apply-patches: use appropriate TAR
      package/sunxi-mali-utgard-driver: handle patching the Buildroot way

 .checkpackageignore                                |  1 -
 fs/tar/tar.mk                                      |  2 +-
 package/Makefile.in                                |  2 +-
 package/cvs/cvs.mk                                 |  2 +-
 package/flutter-engine/flutter-engine.mk           |  1 +
 package/flutter-engine/gen-tarball                 |  2 +-
 package/pkg-download.mk                            |  4 ++-
 .../0001-build.sh-do-not-apply-patches.patch       | 39 ++++++++++++++++++++++
 .../sunxi-mali-utgard-driver.mk                    |  3 +-
 support/download/cvs                               |  5 +--
 support/download/helpers                           |  4 +--
 support/scripts/apply-patches.sh                   |  2 +-
 12 files changed, 54 insertions(+), 13 deletions(-)
 create mode 100644 package/sunxi-mali-utgard-driver/0001-build.sh-do-not-apply-patches.patch

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'