livecd-rootfs/live-build/ubuntu-touch/hooks/60-install-click.chroot
Sebastien Bacher bc2b9aed67 Import patches-unapplied version 2.317 to ubuntu/wily-proposed
Imported using git-ubuntu import.

Changelog parent: 2342202959d18f52aacf8a20dd6afed76cf42196

New changelog entries:
  [ Sebastien Bacher ]
  * live-build/ubuntu-desktop-next/hooks/20-extra-files.chroot:
    - create other needed directories
  * live-build/ubuntu-desktop-next/includes.chroot:
    - copy ubuntu-core's include for /etc/hosts and resolv.conf config
  * live-build/ubuntu-desktop-next/hooks/00-uid-gid-fix.chroot_early:
    - copy touch hacks to create needed userdirs (lightdm & usermetrics),
      the users are added by the script and not the usual postinst so their
      uderdirs are not created as they should
  * live-build/ubuntu-desktop-next/hooks/10-remove-documentation.binary:
    - don't remove the copyright and manpages on desktop
  [ Oliver Grawert ]
  * allow install of "multi" click packages in 60-install-click.chroot on
    ubuntu-touch
2015-06-19 08:58:23 +00:00

69 lines
2.4 KiB
Bash
Executable File

#!/bin/sh
set -e
echo "Setting up click packages"
click_uri=http://archive-team.internal/click_packages
click_list=$click_uri/click_list
click_db=/usr/share/click/preinstalled
click_db_custom=/custom/click
mkdir -p -m 755 "$click_db"
chown clickpkg:clickpkg "$click_db"
# some of these get installed to /custom/click
mkdir -p -m 755 "$click_db_custom"
chown clickpkg:clickpkg "$click_db_custom"
tmpdir="$(mktemp -d)"
cleanup () { rm -rf "$tmpdir"; }
trap cleanup EXIT
CLICKARCH=$(dpkg --print-architecture)
wget --no-verbose -O "$tmpdir/click_list" "$click_list"
for package in $(cat "$tmpdir/click_list")
do
if echo $package | egrep -q "_$CLICKARCH.click|_all.click|_unknown.click|_multi.click"; then
echo "Setting up $package"
wget --no-verbose -O "$tmpdir/$package" "$click_uri/$package"
# 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_*|\
com.ubuntu.dropping-letters_*|\
com.ubuntu.filemanager_*|\
com.ubuntu.reminders_*|\
com.ubuntu.shorts_*|\
com.ubuntu.sudoku_*|\
com.ubuntu.terminal_*)
roots="$click_db_custom"
;;
*)
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
click install --force-missing-framework --root="$root" --all-users \
"$tmpdir/$package"
if [ "$root" = "$click_db_custom" ]; then
mv /etc/click/databases/10_core.conf.tmp \
/etc/click/databases/10_core.conf
fi
done
fi
done