Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / installer / linux / debian / postinst
blob7acf8b2ae03fdc5c1f67115add270b0d3caa2cf8
1 #!/bin/sh
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 set -e
9 @@include@@../common/postinst.include
11 # Add to the alternatives system
13 # On Ubuntu 12.04, we have the following priorities
14 # (which can be obtain be installing browsers and running
15 # update-alternatives --query x-www-browser):
17 # /usr/bin/epiphany-browser 85
18 # /usr/bin/firefox 40
19 # /usr/bin/konqueror 30
21 # While we would expect these values to be keyed off the most popular
22 # browser (Firefox), in practice, we treat Epiphany as the lower bound,
23 # resulting in the following scheme:
25 CHANNEL=@@CHANNEL@@
26 case $CHANNEL in
27 stable )
28 # Good enough to be the default.
29 PRIORITY=200
31 beta )
32 # Almost good enough to be the default. (Firefox stable should arguably be
33 # higher than this, but since that's below the "Epiphany threshold", we're
34 # not setting our priority below it. Anyone want to poke Firefox to raise
35 # their priority?)
36 PRIORITY=150
38 unstable )
39 # Unstable, give it the "lowest" priority.
40 PRIORITY=120
42 * )
43 PRIORITY=0
45 esac
47 update-alternatives --install /usr/bin/x-www-browser x-www-browser \
48 /usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
49 update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser \
50 /usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
52 update-alternatives --install /usr/bin/google-chrome google-chrome \
53 /usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
55 @@include@@../common/apt.include
57 @@include@@../common/symlinks.include
59 remove_udev_symlinks
61 ## MAIN ##
62 if [ ! -e "$DEFAULTS_FILE" ]; then
63 echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
64 echo 'repo_reenable_on_distupgrade="true"' >> "$DEFAULTS_FILE"
67 # Run the cron job immediately to perform repository configuration.
68 nohup sh /etc/cron.daily/@@PACKAGE@@ > /dev/null 2>&1 &