Drop test data with problematic license status
This commit is contained in:
parent
0859683087
commit
500fd9ab06
4 changed files with 58 additions and 23 deletions
34
get_source
Executable file
34
get_source
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
if [ "$#" != '1' ]
|
||||
then
|
||||
cat 1>&2 <<EOF
|
||||
Usage: $0 VERSION
|
||||
|
||||
Downloads the requested version and creates a filtered source tarball.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="${1}"
|
||||
OUTDIR="${PWD}"
|
||||
TMPDIR="$(mktemp -d)"
|
||||
trap "rm -rf '${TMPDIR}'" INT TERM EXIT
|
||||
|
||||
cd "${TMPDIR}"
|
||||
URL="$(rpm -E "%{pypi_source chardet ${VERSION}}")"
|
||||
echo "--> Downloading: ${URL}" 1>&2
|
||||
curl -L -O "${URL}"
|
||||
|
||||
ARCHIVE="$(find . -mindepth 1 -maxdepth 1 -type f -name '*.tar.gz' -print -quit)"
|
||||
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
|
||||
tar -xzf "${ARCHIVE}"
|
||||
echo '--> Removing tests due to licensing issues' 1>&2
|
||||
rm -rvf */tests/
|
||||
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.xz"
|
||||
echo "--> Re-archiving: ${FILTERED}" 1>&2
|
||||
tar -c "${FILTERED}" */ | xz -9e > "${FILTERED}"
|
||||
mv -v "${FILTERED}.xz" "${OUTDIR}"
|
||||
echo 'Done.' 1>&2
|
||||
Loading…
Add table
Add a link
Reference in a new issue