python3.11-lxml/SOURCES/get-lxml-source.sh

29 lines
797 B
Bash
Raw Normal View History

2023-03-28 12:46:52 +00:00
#! /bin/bash -ex
# Download a release of lxml (if missing) and remove the isoschematron module from it
version=$1
if [ -z "${version}" ]; then
echo "Usage: $0 VERSION" >& 2
echo "" >& 2
echo "example: $0 4.9.2" >& 2
exit 1
fi
versionedname=lxml-${version}
orig_archive=${versionedname}.tar.gz
2024-03-27 20:22:07 +00:00
new_archive=${versionedname}-no-isoschematron-rng.tar.gz
2023-03-28 12:46:52 +00:00
if [ ! -e ${orig_archive} ]; then
wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive}
fi
2024-03-27 20:22:07 +00:00
deleted_directory=lxml-${version}/src/lxml/isoschematron/resources/rng
2023-03-28 12:46:52 +00:00
# tar --delete does not operate on compressed archives, so do
# gz decompression explicitly
gzip --decompress ${orig_archive}
2024-03-27 20:22:07 +00:00
tar -v --delete -f ${orig_archive//.gz} ${deleted_directory}
2023-03-28 12:46:52 +00:00
gzip -cf ${orig_archive//.gz} > ${new_archive}