PyMca/getsources.sh
Zbigniew Jędrzejewski-Szmek 3bf2d233be Upgrade to 5.4.3
2019-04-30 17:11:33 +02:00

25 lines
606 B
Bash
Executable file

#!/bin/sh -e
# Usage: ./getsources.sh [version]
# (this produces pymca-[version]-filtered.tar.xz)
if [ -n "$1" ]; then
version="$1"
else
version="$(awk '/^Version:/{print $2}' *.spec)"
fi
fname="pymca-${version}-filtered.tar.xz"
if [ -e "$fname" ]; then
echo "$fname already exists, not downloading"
exit 0
fi
echo "Downloading version ${version}"
[ -x /bin/pxz ] && xz=pxz || xz=xz
curl -sSL https://github.com/vasole/pymca/archive/v${version}/PyMca-${version}.tar.gz | \
zcat | \
tar --delete --wildcards -f - '*/sift/*' | \
$xz -9v > "$fname"
echo "$fname is ready"