summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiankang.fan <jiankang.fan@samsung.com>2020-11-24 11:41:15 +0900
committerjiankang.fan <jiankang.fan@samsung.com>2020-11-24 11:41:15 +0900
commitd6bc0a1c6eee9256df4a27308813c78768c6b0a9 (patch)
treecfd8eba25ddb56c8b79dbfb0232a91c8cba0bfeb
parentae34b3e7059a42bdfeb7e81e745b1bcf07cce9ae (diff)
downloadbuild-d6bc0a1c6eee9256df4a27308813c78768c6b0a9.tar.gz
build-d6bc0a1c6eee9256df4a27308813c78768c6b0a9.tar.bz2
build-d6bc0a1c6eee9256df4a27308813c78768c6b0a9.zip
Support zstd decompression for old rpm version
Change-Id: I8d3b55144ec94f6bd1fbd0162548f814eb8a569d Signed-off-by: jiankang.fan <jiankang.fan@samsung.com>
-rw-r--r--build-pkg-rpm13
1 files changed, 11 insertions, 2 deletions
diff --git a/build-pkg-rpm b/build-pkg-rpm
index 2c385cc..f8ab32a 100644
--- a/build-pkg-rpm
+++ b/build-pkg-rpm
@@ -146,15 +146,24 @@ pkg_preinstall_rpm() {
case `rpm -qp --nodigest --nosignature --qf "%{PAYLOADCOMPRESSOR}\n" "'$BUILD_ROOT'/.init_b_cache/rpms/$PKG.rpm"` in
lzma) rpm --showrc | egrep 'PayloadIsLzma|_lzma' > /dev/null || PAYLOADDECOMPRESS="lzma -d" ;;
xz) rpm --showrc | egrep 'PayloadIsXz|_xz' > /dev/null || PAYLOADDECOMPRESS="xz -d" ;;
+ zstd) rpm --showrc | egrep 'PayloadIsZstd' > /dev/null || PAYLOADDECOMPRESS="zstd -d" ;;
esac
if test "$PAYLOADDECOMPRESS" = "lzma -d" ; then
if ! lzma </dev/null >/dev/null 2>&1 ; then
- test -f "$BUILD_DIR/lzmadec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/lzmadec.sh"
+ test -f "$BUILD_DIR/lzmadec.sh" || cleanup_and_exit 3 "no lzma decoder available in host system"
+ PAYLOADDECOMPRESS="bash $BUILD_DIR/lzmadec.sh"
fi
fi
if test "$PAYLOADDECOMPRESS" = "xz -d" ; then
if ! xz </dev/null >/dev/null 2>&1 ; then
- test -f "$BUILD_DIR/xzdec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/xzdec.sh"
+ test -f "$BUILD_DIR/xzdec.sh" || cleanup_and_exit 3 "no xz decoder available in host system"
+ PAYLOADDECOMPRESS="bash $BUILD_DIR/xzdec.sh"
+ fi
+ fi
+ if test "$PAYLOADDECOMPRESS" = "zstd -d" ; then
+ if ! zstd </dev/null >/dev/null 2>&1 ; then
+ test -f "$BUILD_DIR/zstddec.sh" || cleanup_and_exit 3 "no zstd decoder available in host system"
+ PAYLOADDECOMPRESS="bash $BUILD_DIR/zstddec.sh
fi
fi
if test "$PAYLOADDECOMPRESS" = cat ; then