Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh
blob: 0118a531ef73fdb1902fe7b69ebe5b2fb46cd46d (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
# 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)
experimental=$(read_config sugarlabs_activities experimental)
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}"
	[ "$experimental" = "1" ] && qurl="${qurl}&experimental=1"

	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"
	install_sugar_bundle $cache/$(basename "$aurl")
done
IFS=$oIFS