From: Matthias Schiffer Date: Sun, 17 May 2020 11:18:10 +0000 (+0200) Subject: build: add zstd support to pack/unpack functions X-Git-Tag: v21.02.0-rc1~2639 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4696112ea28299a805ef7de5aff32451adfb2fc3;p=openwrt%2Fstaging%2Fhauke.git build: add zstd support to pack/unpack functions Signed-off-by: Matthias Schiffer --- diff --git a/include/download.mk b/include/download.mk index 14d68bf8f5..9c8ada052b 100644 --- a/include/download.mk +++ b/include/download.mk @@ -50,6 +50,7 @@ endef dl_pack/bz2=bzip2 -c > $(1) dl_pack/gz=gzip -nc > $(1) dl_pack/xz=xz -zc -7e > $(1) +dl_pack/zst=zstd -T0 --ultra -20 -c > $(1) dl_pack/unknown=$(error ERROR: Unknown pack format for file $(1)) define dl_pack $(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown)) diff --git a/include/unpack.mk b/include/unpack.mk index 6141b1c722..5bb27d41c9 100644 --- a/include/unpack.mk +++ b/include/unpack.mk @@ -31,6 +31,10 @@ ifeq ($(strip $(UNPACK_CMD)),) EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) DECOMPRESS_CMD:=xzcat $(DL_DIR)/$(PKG_SOURCE) | endif + ifeq (zst,$(EXT)) + EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) + DECOMPRESS_CMD:=zstdcat $(DL_DIR)/$(PKG_SOURCE) | + endif ifeq ($(filter tgz tbz tbz2 txz,$(EXT1)),$(EXT1)) EXT:=tar endif