Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin@laptop.org>2012-07-24 18:29:51 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-08-20 20:32:31 (GMT)
commite3c6a9d7350d95f94e0d6ed5b18d7e8956893049 (patch)
treeca523cbf265d9f085f2567d8576cff84569e8b24
parent7bf61f35f60f486a84d66242a068c00cf5712a8e (diff)
sugarlabs_activities: add cacheonly support
-rw-r--r--modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh b/modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh
index 0118a53..c090aa4 100644
--- a/modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh
+++ b/modules/sugarlabs_activities/kspost.60.nochroot.aslo.sh
@@ -16,15 +16,28 @@ for id in $activities; do
[ -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
+ qurlcache="${cache}/${id}"
+ [ -n "$sugarver" ] && qurlcache="${qurlcache}-s${sugarver}"
+ [ "$experimental" = "1" ] && qurlcache="${qurlcache}-experimental"
+ qurlcache="${qurlcache}.url"
+
+ if [ -n "$OOB__cacheonly" ]; then
+ echo "Using cache for ${id}" >&2
+ aurl=$(<$qurlcache)
+ else
+ 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 "${aurl}" > "${qurlcache}"
fi
- echo "Downloading from $aurl ..." >&2
- wget --no-verbose --inet4-only -P $cache -N "$aurl"
+ if [ -z "$OOB__cacheonly" ]; then
+ echo "Downloading from $aurl ..." >&2
+ wget --no-verbose --inet4-only -P $cache -N "$aurl"
+ fi
install_sugar_bundle $cache/$(basename "$aurl")
done
IFS=$oIFS