tar -czvf ${PACKAGE_ROOT}/nvidia-container-toolkit_${VERSION#v}_deb_amd64.tar.gz ${PACKAGE_ROOT}/packages/ubuntu18.04/amd64/*_${PACKAGE_VERSION}-1_amd64.deb
tar -czvf ${PACKAGE_ROOT}/nvidia-container-toolkit_${VERSION#v}_deb_arm64.tar.gz ${PACKAGE_ROOT}/packages/ubuntu18.04/arm64/*_${PACKAGE_VERSION}-1_arm64.deb
tar -czvf ${PACKAGE_ROOT}/nvidia-container-toolkit_${VERSION#v}_rpm_aarch64.tar.gz ${PACKAGE_ROOT}/packages/centos7/aarch64/*-${PACKAGE_VERSION}-1.aarch64.rpm
tar -czvf ${PACKAGE_ROOT}/nvidia-container-toolkit_${VERSION#v}_rpm_x86_64.tar.gz ${PACKAGE_ROOT}/packages/centos7/x86_64/*-${PACKAGE_VERSION}-1.x86_64.rpm
is_command()(
command -v "$1" >/dev/null
)
hash_sha256()(
TARGET=${1:-/dev/stdin}
if is_command gsha256sum;then
hash=$(gsha256sum "$TARGET")||return1
echo"$hash"| cut -d ' ' -f 1
elif is_command sha256sum;then
hash=$(sha256sum "$TARGET")||return1
echo"$hash"| cut -d ' ' -f 1
elif is_command shasum;then
hash=$(shasum -a 256"$TARGET" 2>/dev/null)||return1