lvm2/tests/get_lvm2_tarball.sh
Marian Csontos bceb5e6eb9 Remove dependency on dlm
Also update license tags to SPDX compatible identifiers

Resolves: RHEL-54266
2024-09-13 10:03:06 +02:00

31 lines
649 B
Bash

#!/usr/bin/sh
set -e
PKG=$1
[[ "$PKG" == lvm2 ]]
CHECK=false
cat sources | \
while read SHA512_HEADER TARBALL EQUAL HASH; do
if [[ "$SHA512_HEADER" == SHA512 ]]; then
TARBALL=$(echo $TARBALL |sed 's/.\(.*\)./\1/')
CHECK="sha512sum"
else
HASH="$SHA512_HEADER"
CHECK="md5sum"
fi
if [[ -f "$TARBALL" ]] && "$CHECK" -c sources; then
echo "File already downloaded and verified"
else
URL="https://sourceware.org/pub/$PKG/releases/$TARBALL"
echo "Fetching '$URL'..."
curl -k -o "$TARBALL" "$URL"
echo "Checking hash of '$TARBALL'..."
"$CHECK" -c sources
fi
done