File: python3-plainbox.preinst

package info (click to toggle)
plainbox 0.25-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,928 kB
  • ctags: 6,422
  • sloc: python: 38,849; xml: 16,029; sh: 33; makefile: 32
file content (44 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/sh
# Pre-install script for ‘python3-plainbox’.
#
# Manpage: ‘dh_installdeb(1)’

set -e

# Summary of ways this script can be called:
#   * <new-preinst> install
#   * <new-preinst> install <old-version>
#   * <new-preinst> upgrade <old-version>
#   * <old-preinst> abort-upgrade <new-version>
# For details, see the Debian Policy §6.5 in the ‘debian-policy’ package
# or on the web at <URL:http://www.debian.org/doc/debian-policy/>.

action="$1"

case "$action" in
    upgrade)
        data_dir="/usr/lib/python3/dist-packages/plainbox/data"
        if [ -d "$data_dir" ] && [ ! -L "$data_dir" ] ; then
            # The ‘data’ location should be platform-independent.
            # The new package will replace the directory with a symlink.
            rm -rf "$data_dir"
        fi
        testdata_dir="/usr/lib/python3/dist-packages/plainbox/test-data"
        if [ -d "$testdata_dir" ] && [ ! -L "$testdata_dir" ] ; then
            # The ‘data’ location should be platform-independent.
            # The new package will replace the directory with a symlink.
            rm -rf "$testdata_dir"
        fi
        ;;

    install|abort-upgrade)
        ;;

    *)
        printf "preinst called with unknown action ‘%s’\n" "$action" >&2
        exit 1
        ;;

esac

#DEBHELPER#