5
echo "Prints source adress of Kadu module, icon theme, sound theme or other."
6
echo "Usage: $0 <item_type> <item_names>"
11
if test -f ../VERSION; then
12
KADU_VERSION=`cat ../VERSION`
13
elif test -f ../../VERSION; then
14
KADU_VERSION=`cat ../../VERSION`
16
KADU_VERSION=`cat ../../../VERSION`
19
KADU_VERSION=`echo $KADU_VERSION | sed s/-.*//`
24
KADU_VERSIONS="$3 $4 $5 $6 $7 $8"
25
# calculate the list of previous kadu versions
26
# will be used to try downloading modules for older releases
27
# when href for current release does not exist
28
if [ ${#KADU_VERSIONS} -ne 0 ]; then
29
if [ ${#KADU_VERSION} == 7 ]; then
30
MINOR=${KADU_VERSION:6:1}
31
MAJOR=${KADU_VERSION:0:5}
32
while [ $MINOR -gt 1 ]; do
33
MINOR=`expr $MINOR - 1`
34
KADU_VERSIONS+=" $MAJOR.$MINOR"
39
function autodownload()
41
if [ ! -f $1.web ]; then
45
ITEM_WEBSITES=`cat $1.web`
46
if [ -z "$ITEM_WEBSITES" ]; then
47
echo -e "\033[31m!!!\033[0m ERROR: Homepage for $1 $2 is unknown"
53
for ITEM_WEBSITE in $ITEM_WEBSITES; do
54
if wget -q -T 20 -t 2 -N $ITEM_WEBSITE/kadu-$KADU_VERSION-$1.href; then
55
ITEM_HREFS=`cat kadu-$KADU_VERSION-$1.href`
60
if test -z "$ITEM_HREFS"; then
61
#downloading packages for other versions of Kadu
62
if [ ${#KADU_VERSIONS} -ne 0 ]; then
63
for VER in $KADU_VERSIONS; do
64
for ITEM_WEBSITE in $ITEM_WEBSITES; do
65
if wget -q -T 20 -t 2 -N $ITEM_WEBSITE/kadu-$VER-$1.href; then
66
ITEM_HREFS=`cat kadu-$VER-$1.href`
70
if ! test -z "$ITEM_HREFS"; then
76
if test -z "$ITEM_HREFS"; then
77
echo -e "\033[31m!!!\033[0m ERROR: Downloading of $1 $2 href-file failed"
92
autodownload `basename $name .web` $type