aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxice8 <thinkabit.ukim@gmail.com>2019-04-13 16:42:08 +0000
committermaxice8 <30738253+maxice8@users.noreply.github.com>2019-04-15 15:18:00 +0000
commitf5c0feedf699c6c8d7bae10b3d9976748fc1526e (patch)
tree85fea8def306b08a9dc7a1a610ca49b000e22c5c
parent8fff9cee19f67043e14df1af6c3bae0c0bb83b24 (diff)
downloadvoid-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar.gz
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar.bz2
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar.lz
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar.xz
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.tar.zst
void-packages-f5c0feedf699c6c8d7bae10b3d9976748fc1526e.zip
00-distfiles: avoid useless use of cat
-rw-r--r--common/hooks/do-fetch/00-distfiles.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/hooks/do-fetch/00-distfiles.sh b/common/hooks/do-fetch/00-distfiles.sh
index a07d0af7f4a..e2220789c59 100644
--- a/common/hooks/do-fetch/00-distfiles.sh
+++ b/common/hooks/do-fetch/00-distfiles.sh
@@ -50,20 +50,20 @@ contents_cksum() {
case ${cursufx} in
tar|txz|tbz|tlz|tgz|crate)
- cksum=$(tar xf "$curfile" --to-stdout | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(tar xf "$curfile" --to-stdout))
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile to pipe.\n"
fi
;;
gz)
- cksum=$(gunzip -c "$curfile" | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(gunzip -c "$curfile"))
;;
bz2)
- cksum=$(bunzip2 -c "$curfile" | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(bunzip2 -c "$curfile"))
;;
zip)
if command -v unzip &>/dev/null; then
- cksum=$(unzip -p "$curfile" | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(unzip -p "$curfile"))
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile to pipe.\n"
fi
@@ -73,7 +73,7 @@ contents_cksum() {
;;
rpm)
if command -v rpmextract &>/dev/null; then
- cksum=$(rpm2cpio "$curfile" | bsdtar xf - --to-stdout | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(rpm2cpio "$curfile" | bsdtar xf - --to-stdout))
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile to pipe.\n"
fi
@@ -82,11 +82,11 @@ contents_cksum() {
fi
;;
txt)
- cksum=$(cat "$curfile" | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD "$curfile")
;;
7z)
if command -v 7z &>/dev/null; then
- cksum=$(7z x -o "$curfile" | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(7z x -o "$curfile"))
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile to pipe.\n"
fi
@@ -95,7 +95,7 @@ contents_cksum() {
fi
;;
gem)
- cksum=$(tar -xf "$curfile" data.tar.gz --to-stdout | tar -xzO | sha256sum | awk '{print $1}')
+ cksum=$($XBPS_DIGEST_CMD <(tar -xf "$curfile" data.tar.gz --to-stdout | tar -xzO ))
;;
*)
msg_error "$pkgver: cannot guess $curfile extract suffix. ($cursufx)\n"