blob: 12dd39bfccf6b8928113c32a52fe38b6f0558777 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# Copyright (C) 2009 One Laptop Per Child
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
. $OOB__shlib
sugarver=$(read_config sugarlabs_activities sugar_version)
activities=$(read_config sugarlabs_activities activities)
cache=$cachedir/activities
mkdir -p $cache
oIFS=$IFS
IFS=$'\n\t, '
for id in $activities; do
qurl="http://activities.sugarlabs.org/services/update-aslo.php?id=$id"
[ -n "$sugarver" ] && qurl="${qurl}&appVersion=${sugarver}"
echo "Examining $qurl ..." >&2
aurl=$(wget --inet4-only -q -O- "$qurl" | grep updateLink | sed -e 's/[[:space:]]*<[^>]*>//g')
if [ -z "$aurl" ]; then
echo "ERROR: Could not find download URL for $id" >&2
exit 1
fi
echo "Downloading from $aurl ..." >&2
wget --no-verbose --inet4-only -P $cache -N "$aurl"
outfile=$cache/$(basename "$aurl")
if [ "${outfile:(-4)}" == ".xol" ]; then
echo "unzip -d \$INSTALL_ROOT/home/olpc/Library -q '$outfile'"
else
echo "unzip -d \$INSTALL_ROOT/home/olpc/Activities -q '$outfile'"
fi
done
IFS=$oIFS
echo 'chown -R 500:500 $INSTALL_ROOT/home/olpc/{Activities,Library}'
|