Blame SOURCES/get-lxml-source.sh

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