]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
download: improve rawgit tar reliability 19243/head
authorOndrej Cierny <o.cierny@gmail.com>
Fri, 27 Jun 2025 02:39:37 +0000 (19:39 -0700)
committerRobert Marko <robimarko@gmail.com>
Mon, 30 Jun 2025 08:39:05 +0000 (10:39 +0200)
Packages that depend on rawgit can fail on systems with the tar UID
issue (https://bugzilla.redhat.com/show_bug.cgi?id=913406).
Fix this by adding tar flags to overwrite UID/GID, as in the
dl_tar_pack method.

Signed-off-by: Ondrej Cierny <o.cierny@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19243
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/download.mk

index 7f343027735034edaf928fdbb22eef4c8a7117d3..518a14e035176527d8be52edb0f2de173efd1aeb 100644 (file)
@@ -232,7 +232,9 @@ define DownloadMethod/rawgit
        echo "Generating formal git archive (apply .gitattributes rules)" && \
        (cd $(SUBDIR) && git config core.abbrev 8 && \
        git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \
-       $(if $(filter skip,$(SUBMODULES)),true,$(TAR) --ignore-failed-read -C $(SUBDIR) -f $(SUBDIR).tar.git -r .git .gitmodules 2>/dev/null) && \
+       $(if $(filter skip,$(SUBMODULES)),true, \
+               $(TAR) --numeric-owner --owner=0 --group=0 --ignore-failed-read -C $(SUBDIR) -f $(SUBDIR).tar.git -r .git .gitmodules 2>/dev/null \
+       ) && \
        rm -rf $(SUBDIR) && mkdir $(SUBDIR) && \
        $(TAR) -C $(SUBDIR) -xf $(SUBDIR).tar.git && \
        (cd $(SUBDIR) && $(if $(filter skip,$(SUBMODULES)),true,git submodule update --init --recursive -- $(SUBMODULES) && \