2013-07-17 00:05:49 -03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-09-06 13:21:42 +01:00
|
|
|
set -e
|
2013-07-17 00:05:49 -03:00
|
|
|
|
|
|
|
echo "Setting up click packages"
|
|
|
|
|
2016-09-14 14:27:40 -05:00
|
|
|
CLICKARCH=$(dpkg --print-architecture)
|
|
|
|
|
2013-09-06 13:21:42 +01:00
|
|
|
click_uri=http://archive-team.internal/click_packages
|
2016-09-14 14:27:40 -05:00
|
|
|
if [ "$CLICKARCH" = "arm64" ]; then
|
|
|
|
# FIXME: this is temporary. Since right now we can't have arm64 clicks in the store
|
|
|
|
# (before implementing fat-packages), we need to fetch the arm64 click list from a
|
|
|
|
# different place
|
|
|
|
click_list=$click_uri/click_list.arm64
|
|
|
|
click_install_flags="--allow-unauthenticated"
|
|
|
|
else
|
|
|
|
click_list=$click_uri/click_list
|
|
|
|
click_install_flags=""
|
|
|
|
fi
|
2013-09-05 11:29:17 +01:00
|
|
|
click_db=/usr/share/click/preinstalled
|
2014-10-14 00:12:08 +01:00
|
|
|
click_db_custom=/custom/click
|
2013-08-26 17:22:14 -03:00
|
|
|
|
2013-09-05 11:29:17 +01:00
|
|
|
mkdir -p -m 755 "$click_db"
|
|
|
|
chown clickpkg:clickpkg "$click_db"
|
|
|
|
|
2014-10-14 00:12:08 +01:00
|
|
|
# some of these get installed to /custom/click
|
|
|
|
mkdir -p -m 755 "$click_db_custom"
|
|
|
|
chown clickpkg:clickpkg "$click_db_custom"
|
|
|
|
|
2013-09-05 11:29:17 +01:00
|
|
|
tmpdir="$(mktemp -d)"
|
|
|
|
cleanup () { rm -rf "$tmpdir"; }
|
|
|
|
trap cleanup EXIT
|
2013-07-17 00:05:49 -03:00
|
|
|
|
2013-09-06 11:48:25 +01:00
|
|
|
wget --no-verbose -O "$tmpdir/click_list" "$click_list"
|
|
|
|
for package in $(cat "$tmpdir/click_list")
|
2013-07-17 00:05:49 -03:00
|
|
|
do
|
2015-06-19 10:52:07 +02:00
|
|
|
if echo $package | egrep -q "_$CLICKARCH.click|_all.click|_unknown.click|_multi.click"; then
|
2013-11-26 15:14:18 +01:00
|
|
|
echo "Setting up $package"
|
|
|
|
wget --no-verbose -O "$tmpdir/$package" "$click_uri/$package"
|
2014-10-14 00:12:08 +01:00
|
|
|
# FIXME: first attempt, a hard-coded list of the packages that go to
|
|
|
|
# the custom tarball
|
|
|
|
case $package in
|
|
|
|
com.ubuntu.developer.webapps.webapp-amazon_*|\
|
|
|
|
com.ubuntu.developer.webapps.webapp-ebay_*|\
|
|
|
|
com.ubuntu.developer.webapps.webapp-facebook_*|\
|
|
|
|
com.ubuntu.developer.webapps.webapp-gmail_*|\
|
|
|
|
com.ubuntu.developer.webapps.webapp-twitter_*|\
|
2015-07-08 15:08:15 -07:00
|
|
|
com.ubuntu.scopes.youtube_*|\
|
2014-10-14 00:12:08 +01:00
|
|
|
com.ubuntu.dropping-letters_*|\
|
|
|
|
com.ubuntu.filemanager_*|\
|
|
|
|
com.ubuntu.reminders_*|\
|
2014-11-12 23:15:15 -08:00
|
|
|
com.ubuntu.shorts_*|\
|
2014-10-14 00:12:08 +01:00
|
|
|
com.ubuntu.sudoku_*|\
|
2016-03-15 12:56:32 +01:00
|
|
|
com.ubuntu.terminal_*|\
|
|
|
|
com.ubuntu.calendar_*|\
|
|
|
|
navigator.costales_*|\
|
|
|
|
dekko.dekkoproject_*)
|
2014-10-15 21:07:38 +01:00
|
|
|
roots="$click_db_custom"
|
2014-10-14 00:12:08 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
roots="$click_db"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
for root in $roots; do
|
|
|
|
if [ "$root" = "$click_db_custom" ]; then
|
|
|
|
# FIXME: there is no good way to stop click from
|
|
|
|
# deduplicating things when installing the same package in
|
|
|
|
# multiple databases; the best we can do is to temporarily
|
|
|
|
# pretend that the core database does not exist
|
|
|
|
mv /etc/click/databases/10_core.conf \
|
|
|
|
/etc/click/databases/10_core.conf.tmp
|
|
|
|
fi
|
2016-09-14 14:27:40 -05:00
|
|
|
click install --force-missing-framework --root="$root" --all-users $click_install_flags \
|
2014-10-14 00:12:08 +01:00
|
|
|
"$tmpdir/$package"
|
|
|
|
if [ "$root" = "$click_db_custom" ]; then
|
|
|
|
mv /etc/click/databases/10_core.conf.tmp \
|
|
|
|
/etc/click/databases/10_core.conf
|
|
|
|
fi
|
|
|
|
done
|
2013-11-26 15:14:18 +01:00
|
|
|
fi
|
2013-07-17 00:05:49 -03:00
|
|
|
done
|