Blame SOURCES/get-lxml-source.sh

4bf35c
#! /bin/bash -ex
4bf35c
4bf35c
# Download a release of lxml (if missing) and remove the isoschematron module from it
4bf35c
4bf35c
version=$1
4bf35c
4bf35c
if [ -z "${version}" ]; then
4bf35c
    echo "Usage: $0 VERSION" >& 2
4bf35c
    echo "" >& 2
4bf35c
    echo "example: $0 4.9.2" >& 2
4bf35c
    exit 1
4bf35c
fi
4bf35c
4bf35c
versionedname=lxml-${version}
4bf35c
orig_archive=${versionedname}.tar.gz
4bf35c
new_archive=${versionedname}-no-isoschematron.tar.gz
4bf35c
4bf35c
if [ ! -e ${orig_archive} ]; then
4bf35c
    wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive}
4bf35c
fi
4bf35c
4bf35c
deleted_module=lxml-${version}/src/lxml/isoschematron/
4bf35c
deleted_test=lxml-${version}/src/lxml/tests/test_isoschematron.py
4bf35c
4bf35c
# tar --delete does not operate on compressed archives, so do
4bf35c
# gz decompression explicitly
4bf35c
gzip --decompress ${orig_archive}
4bf35c
tar -v --delete -f ${orig_archive//.gz} {$deleted_module,$deleted_test}
4bf35c
gzip -cf ${orig_archive//.gz} > ${new_archive}