Blame SOURCES/get-lxml-source.sh

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