debian/canfestival-peak.postrm
changeset 579 3126da40d469
parent 533 4d50417dab22
equal deleted inserted replaced
578:eb67d9aa714f 579:3126da40d469
     1 #!/bin/sh
     1 #!/bin/sh
     2 # postinst script for canfestival
     2 # postrm script for canfestival
     3 #
       
     4 # see: dh_installdeb(1)
       
     5 
     3 
     6 set -e
     4 set -e
     7 
     5 
     8 # summary of how this script can be called:
       
     9 #        * <postinst> `configure' <most-recently-configured-version>
       
    10 #        * <old-postinst> `abort-upgrade' <new version>
       
    11 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
       
    12 #          <new-version>
       
    13 #        * <postinst> `abort-remove'
       
    14 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
       
    15 #          <failed-install-package> <version> `removing'
       
    16 #          <conflicting-package> <version>
       
    17 # for details, see http://www.debian.org/doc/debian-policy/ or
       
    18 # the debian-policy package
       
    19 
       
    20 DLL_LIST=
     6 DLL_LIST=
       
     7 CF_CONFIG_DIR=/usr/share/CanFestival-3/objdictgen/
    21 CF_CONFIG=/usr/share/CanFestival-3/objdictgen/canfestival_config.py
     8 CF_CONFIG=/usr/share/CanFestival-3/objdictgen/canfestival_config.py
    22 CF_CONFIG_TEMP=/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py
     9 CF_CONFIG_TEMP=/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py
    23 
    10 
    24 case "$1" in
    11 case "$1" in
    25     configure)
    12     configure)
    26     ;;
    13     ;;
    27 	
    14 	
    28     remove|purge)
    15     purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    29     ldconfig
    16     
    30     cd /usr/lib
    17     if [ -d $CF_CONFIG_DIR ];then
    31     cd /usr/lib
    18 	    ldconfig
    32 	DLL_LIST=
    19 	    # Find canfestival driver library in /usr/lib
    33 	FILES=
    20 	    cd /usr/lib
    34 
    21 		for file in `ls libcanfestival_can* 2>/dev/null`
    35 	for file in libcanfestival_can*
    22 		do
    36 	do
    23 			DLL_LIST="'$file',""$DLL_LIST"
    37 		DLL_LIST="'$file',""$DLL_LIST"
    24 		done
    38 	done
    25 		
    39 
    26 		# copy template config and add the DLL_LIST 
    40 	cat $CF_CONFIG_TEMP > $CF_CONFIG
    27 		# do this to display available canfestival plugin list choice in beremiz
    41 	echo "DLL_LIST=[$DLL_LIST]" >> $CF_CONFIG
    28 		cat $CF_CONFIG_TEMP > $CF_CONFIG
       
    29 		echo "DLL_LIST=[$DLL_LIST]" >> $CF_CONFIG
       
    30 	fi
    42 	;;
    31 	;;
    43     
    32     
    44     abort-upgrade|abort-remove|abort-deconfigure)
       
    45     ;;
       
    46 
       
    47     *)
    33     *)
    48         echo "postinst called with unknown argument \`$1'" >&2
    34         echo "postrm called with unknown argument \`$1'" >&2
    49         exit 1
    35         exit 1
    50     ;;
    36     ;;
    51 esac
    37 esac
    52 
    38 
    53 # dh_installdeb will replace this with shell code automatically
    39 # dh_installdeb will replace this with shell code automatically