#!/bin/sh # postinst script for Nylas # # see: dh_installdeb(1) # summary of how this script can be called: # * `configure' # * abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package UBUNTU_CODENAMES="lucid maverick natty oneiric precise quantal raring saucy trusty utopic vivid" DEBIAN_CODENAMES="squeeze wheezy jessie sid" case "$1" in configure) gtk-update-icon-cache /usr/share/icons/hicolor > /dev/null 2>&1 DISTRO=`lsb_release -s -i` if [ "$DISTRO" = "Ubuntu" ]; then DISTS=$UBUNTU_CODENAMES DISTRO="ubuntu" elif [ "$DISTRO" = "Debian" ]; then DISTS=$DEBIAN_CODENAMES DISTRO="debian" else echo "You are not running Debian or Ubuntu. Not adding Nylas repository." DISTRO="" fi if [ -n "$DISTRO" ]; then # Add the Nylas repository. # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license. # Install the repository signing key install_key() { APT_KEY="`which apt-key 2> /dev/null`" if [ -x "$APT_KEY" ]; then "$APT_KEY" add - >/dev/null 2>&1 </dev/null | cut -d ':' -f 1) if [ -n "$SOURCELIST" ]; then return 0 fi printf "$REPOCONFIG\n" > "$APT_SOURCESDIR/nylas.list" if [ $? -eq 0 ]; then return 1 fi fi return 2 } install_key update_sources_lists fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac set -e exit 0