Newer
Older
# Downloader for agreement between Troll Tech and KDE Free Qt Foundation.
#
# KDE presents the agreement as a series of PNG files on their site,
# which is less convenient than assembling that into a PDF. But we
# don't have permission to distribute an assembled PDF, so instead we
# have this script, which lets a user take the PNG files and make
# their own PDF.
SCRIPTNAME=dosh
BASEDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/..
# Call the upstream dosh
watch(){ ${OTS_DOCTOOLS_DIR}/dosh ${FUNCNAME[0]} "$@"; }
verify_pdf_links(){ ${OTS_DOCTOOLS_DIR}/dosh ${FUNCNAME[0]} "$@"; }
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
_dload(){
if [ -f "$2" ]; then
return
fi
wget -O $2 $1
}
docs_kde() {
mkdir -p $BASEDIR/doc/kde/.cache
cd $BASEDIR/doc/kde/.cache
# Don't download if it already exists
if [ -f ../kdefreeqt.pdf ]; then
return
fi
_dload https://kde.org/community/whatiskde/images/kdefreeqt0.png kdefreeqt0.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt1.png kdefreeqt1.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt2.png kdefreeqt2.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt3.png kdefreeqt3.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt4.png kdefreeqt4.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt5.png kdefreeqt5.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt6.png kdefreeqt6.png
_dload https://kde.org/community/whatiskde/images/kdefreeqt7.png kdefreeqt7.png
convert kdefreeqt*.png ../kdefreeqt.pdf
}
docs() {
docs_kde
}
"$@" # <- execute the task
[ "$#" -gt 0 ] || printf "Usage:\n\t./${SCRIPTNAME} %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"