Blame SOURCES/get-lxml-source.sh

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