From 4696112ea28299a805ef7de5aff32451adfb2fc3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 17 May 2020 13:18:10 +0200 Subject: [PATCH] build: add zstd support to pack/unpack functions Signed-off-by: Matthias Schiffer --- include/download.mk | 1 + include/unpack.mk | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/download.mk b/include/download.mk index 14d68bf8f5e..9c8ada052b0 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 6141b1c7225..5bb27d41c9a 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 -- 2.30.2