source: air-manager/trunk/fuentes/debian/air-installer.postinst @ 7375

Last change on this file since 7375 was 7375, checked in by Juanma, 13 months ago

add diversion

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/bash
2setg -e
3
4APP="air-installer"
5EXT="air"
6# Template for diversions
7ORIG_FILE="/usr/share/mime/application/vnd.adobeair-application-installer-package+zip.xml"
8OUR_FILE="/usr/share/mime/package/x-air-installer.xml"
9OUR_PACKAGE="air-installer"
10
11case $1 in
12        configure)
13                # Create mime xml
14                echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
15                <mime-info xmlns=\"http://www.freedesktop.org/standards/shared-mime-info\">
16                    <mime-type type=\"application/x-$APP\">
17                        <comment>Install air app</comment>
18                        <icon name=\"air-installer\"/>
19                        <glob pattern=\"*.$EXT\"/>
20                    </mime-type>
21                </mime-info>" > /usr/share/mime/packages/x-$APP.xml
22                 if dpkg-divert --package ${OUR_PACKAGE} --add  --rename  --divert ${ORIG_FILE}.real ${ORIG_FILE} ; then
23                        ln -fs ${OUR_FILE} ${ORIG_FILE}
24                else
25                        echo "Unabe to divert file ${ORIG_FILE}"
26                fi 
27               
28        ;;
29#update databases for both application and mime
30#update-desktop-database /usr/share/applications
31update-mime-database    /usr/share/mime
32
33#DEBHELPER#
Note: See TracBrowser for help on using the repository browser.