X11rdp: simplify download
Use case-statement instead of many ifs.
This commit is contained in:
parent
3dd485512c
commit
536ac7f9e8
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
download_file()
|
download_file()
|
||||||
{
|
{
|
||||||
|
local file url status
|
||||||
file=$1
|
file=$1
|
||||||
|
|
||||||
# if we already have the file, don't download it
|
# if we already have the file, don't download it
|
||||||
@ -32,90 +33,46 @@ download_file()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd downloads
|
|
||||||
|
|
||||||
echo "downloading file $file"
|
echo "downloading file $file"
|
||||||
if [ "$file" = "pixman-0.15.20.tar.bz2" ]; then
|
case "$file" in
|
||||||
wget -cq http://ftp.x.org/pub/individual/lib/$file
|
pixman-0.15.20.tar.bz2)
|
||||||
status=$?
|
url=http://ftp.x.org/pub/individual/lib/$file ;;
|
||||||
cd ..
|
libdrm-2.4.26.tar.bz2)
|
||||||
return $status
|
url=http://dri.freedesktop.org/libdrm/$file ;;
|
||||||
elif [ "$file" = "libdrm-2.4.26.tar.bz2" ]; then
|
MesaLib-7.10.3.tar.bz2)
|
||||||
wget -cq http://dri.freedesktop.org/libdrm/$file
|
url=ftp://ftp.freedesktop.org/pub/mesa/7.10.3/$file ;;
|
||||||
status=$?
|
freetype-2.4.6.tar.bz2)
|
||||||
cd ..
|
url=http://download.savannah.gnu.org/releases/freetype/$file ;;
|
||||||
return $status
|
xkeyboard-config-2.0.tar.bz2)
|
||||||
elif [ "$file" = "MesaLib-7.10.3.tar.bz2" ]; then
|
url=http://www.x.org/releases/individual/data/xkeyboard-config/$file ;;
|
||||||
wget -cq ftp://ftp.freedesktop.org/pub/mesa/7.10.3/$file
|
makedepend-1.0.3.tar.bz2)
|
||||||
status=$?
|
url=http://xorg.freedesktop.org/releases/individual/util/$file ;;
|
||||||
cd ..
|
libxml2-sources-2.7.8.tar.gz)
|
||||||
return $status
|
url=ftp://ftp.xmlsoft.org/libxml2/$file ;;
|
||||||
elif [ "$file" = "freetype-2.4.6.tar.bz2" ]; then
|
Python-2.5.tar.bz2)
|
||||||
wget -cq http://download.savannah.gnu.org/releases/freetype/$file
|
url=http://www.python.org/ftp/python/2.5/$file ;;
|
||||||
status=$?
|
Python-2.7.tar.bz2)
|
||||||
cd ..
|
url=http://www.python.org/ftp/python/2.7/$file ;;
|
||||||
return $status
|
expat-2.0.1.tar.gz)
|
||||||
elif [ "$file" = "xkeyboard-config-2.0.tar.bz2" ]; then
|
url=http://server1.xrdp.org/xrdp/$file ;;
|
||||||
wget -cq http://www.x.org/releases/individual/data/xkeyboard-config/$file
|
cairo-1.8.8.tar.gz)
|
||||||
status=$?
|
url=http://server1.xrdp.org/xrdp/$file ;;
|
||||||
cd ..
|
libpng-1.2.46.tar.gz)
|
||||||
return $status
|
url=http://server1.xrdp.org/xrdp/$file ;;
|
||||||
elif [ "$file" = "makedepend-1.0.3.tar.bz2" ]; then
|
intltool-0.41.1.tar.gz)
|
||||||
wget -cq http://xorg.freedesktop.org/releases/individual/util/$file
|
url=http://launchpad.net/intltool/trunk/0.41.1/+download/$file ;;
|
||||||
status=$?
|
libxslt-1.1.26.tar.gz)
|
||||||
cd ..
|
url=ftp://xmlsoft.org/libxslt/$file ;;
|
||||||
return $status
|
fontconfig-2.8.0.tar.gz)
|
||||||
elif [ "$file" = "libxml2-sources-2.7.8.tar.gz" ]; then
|
url=http://server1.xrdp.org/xrdp/$file ;;
|
||||||
wget -cq ftp://ftp.xmlsoft.org/libxml2/$file
|
*)
|
||||||
status=$?
|
url=$download_url/$file ;;
|
||||||
cd ..
|
esac
|
||||||
return $status
|
cd downloads
|
||||||
elif [ "$file" = "Python-2.5.tar.bz2" ]; then
|
wget -cq "url"
|
||||||
wget -cq http://www.python.org/ftp/python/2.5/$file
|
status=$?
|
||||||
status=$?
|
cd ..
|
||||||
cd ..
|
return $status
|
||||||
return $status
|
|
||||||
elif [ "$file" = "Python-2.7.tar.bz2" ]; then
|
|
||||||
wget -cq http://www.python.org/ftp/python/2.7/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "expat-2.0.1.tar.gz" ]; then
|
|
||||||
wget -cq http://server1.xrdp.org/xrdp/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "cairo-1.8.8.tar.gz" ]; then
|
|
||||||
wget -cq http://server1.xrdp.org/xrdp/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "libpng-1.2.46.tar.gz" ]; then
|
|
||||||
wget -cq http://server1.xrdp.org/xrdp/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "intltool-0.41.1.tar.gz" ]; then
|
|
||||||
wget -cq http://launchpad.net/intltool/trunk/0.41.1/+download/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "libxslt-1.1.26.tar.gz" ]; then
|
|
||||||
wget -cq ftp://xmlsoft.org/libxslt/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
elif [ "$file" = "fontconfig-2.8.0.tar.gz" ]; then
|
|
||||||
wget -cq http://server1.xrdp.org/xrdp/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
else
|
|
||||||
wget -cq $download_url/$file
|
|
||||||
status=$?
|
|
||||||
cd ..
|
|
||||||
return $status
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_modules()
|
remove_modules()
|
||||||
|
Loading…
Reference in New Issue
Block a user