mirror of
https://git.busybox.net/buildroot.git
synced 2024-11-23 05:23:39 +08:00
package: add support for extracting zstd archives
Teach the generic package handling code how to extract zstd (.tar.zst) archives. When zstd is not installed on the host, host-zstd gets built automatically. Signed-off-by: Matt Staveley-Taylor <matt.stav.taylor@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
2ca698051c
commit
7d0707cae4
@ -177,6 +177,13 @@ config BR2_LZCAT
|
||||
Command to be used to extract a lzip'ed file to stdout.
|
||||
Default is "lzip -d -c"
|
||||
|
||||
config BR2_ZSTDCAT
|
||||
string "zstdcat command"
|
||||
default "zstdcat"
|
||||
help
|
||||
Command to be used to extract a zstd'ed file to stdout.
|
||||
Default is "zstdcat"
|
||||
|
||||
config BR2_TAR_OPTIONS
|
||||
string "Tar options"
|
||||
default ""
|
||||
|
1
Makefile
1
Makefile
@ -446,6 +446,7 @@ ZCAT := $(call qstrip,$(BR2_ZCAT))
|
||||
BZCAT := $(call qstrip,$(BR2_BZCAT))
|
||||
XZCAT := $(call qstrip,$(BR2_XZCAT))
|
||||
LZCAT := $(call qstrip,$(BR2_LZCAT))
|
||||
ZSTDCAT := $(call qstrip,$(BR2_ZSTDCAT))
|
||||
TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
|
||||
|
||||
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
||||
|
@ -59,6 +59,7 @@ INFLATE.tbz = $(BZCAT)
|
||||
INFLATE.tbz2 = $(BZCAT)
|
||||
INFLATE.tgz = $(ZCAT)
|
||||
INFLATE.xz = $(XZCAT)
|
||||
INFLATE.zst = $(ZSTDCAT)
|
||||
INFLATE.tar = cat
|
||||
# suitable-extractor(filename): returns extractor based on suffix
|
||||
suitable-extractor = $(INFLATE$(suffix $(1)))
|
||||
@ -66,6 +67,7 @@ suitable-extractor = $(INFLATE$(suffix $(1)))
|
||||
EXTRACTOR_PKG_DEPENDENCY.lzma = $(BR2_XZCAT_HOST_DEPENDENCY)
|
||||
EXTRACTOR_PKG_DEPENDENCY.xz = $(BR2_XZCAT_HOST_DEPENDENCY)
|
||||
EXTRACTOR_PKG_DEPENDENCY.lz = $(BR2_LZIP_HOST_DEPENDENCY)
|
||||
EXTRACTOR_PKG_DEPENDENCY.zst = $(BR2_ZSTD_HOST_DEPENDENCY)
|
||||
|
||||
# extractor-pkg-dependency(filename): returns a Buildroot package
|
||||
# dependency needed to extract file based on suffix
|
||||
|
4
support/dependencies/check-host-zstd.mk
Normal file
4
support/dependencies/check-host-zstd.mk
Normal file
@ -0,0 +1,4 @@
|
||||
ifeq (,$(call suitable-host-package,zstd,$(ZSTDCAT)))
|
||||
BR2_ZSTD_HOST_DEPENDENCY = host-zstd
|
||||
ZSTDCAT = $(HOST_DIR)/bin/zstdcat
|
||||
endif
|
14
support/dependencies/check-host-zstd.sh
Executable file
14
support/dependencies/check-host-zstd.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
candidate="$1"
|
||||
|
||||
zstdcat=$(which "$candidate" 2>/dev/null)
|
||||
if [ ! -x "$zstdcat" ]; then
|
||||
zstdcat=$(which zstdcat 2>/dev/null)
|
||||
if [ ! -x "$zstdcat" ]; then
|
||||
# echo nothing: no suitable zstdcat found
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$zstdcat"
|
Loading…
Reference in New Issue
Block a user