cd
test -f installed/ReportLab_1_21.tgz && mv installed/ReportLab_1_21.tgz .
test ! -f ReportLab_1_21.tgz &&
wget http://www.reportlab.org/ftp/ReportLab_1_21.tgz
# Become root to install it
su
# Remove old installed copies, extract the new version
# (into every Python site-packages directory that we find)
find /usr/lib/python* -maxdepth 1 -type d -name site-packages 2> /dev/null |
while read pythondir; do
test -d $pythondir/reportlab && rm -r $pythondir/reportlab
tar xzvf ./ReportLab_1_21.tgz -C $pythondir
mv $pythondir/reportlab_1_21 $pythondir/reportlab
chown -R root:root $pythondir/reportlab
rm -f $pythondir/reportlab/MANIFEST
mv $pythondir/reportlab/reportlab/* $pythondir/reportlab/
rmdir $pythondir/reportlab/reportlab
done
# If you ever want to uninstall ReportLab, this should do it:
su -c "find /usr/lib/python*/site-packages -type d -maxdepth 1 \
-name reportlab -exec rm -r {} \;"
rm -f ~/installed/ReportLab-*.tar.*