File: libPVER-stdlib.prerm.in

package info (click to toggle)
python2.7 2.7.18-8%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 78,736 kB
  • sloc: python: 470,452; ansic: 443,657; sh: 17,616; asm: 14,304; makefile: 4,914; objc: 761; exp: 499; javascript: 314; cpp: 128; xml: 76
file content (35 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (5)
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
#! /bin/sh

set -e

remove_bytecode()
{
    pkg=$1
    dpkg -L $1 \
	| awk '/\.py$/ {print $0"c\n" $0"o"}' \
	| xargs -r rm -f >&2
}

case "$1" in
    remove)
	pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W lib@PVER@-stdlib \
            | grep -v '^.n' | wc -l)
	if [ "$pc" -le 1 ]; then
            remove_bytecode lib@PVER@-stdlib@HOST_QUAL@
	fi
        ;;
    upgrade)
	remove_bytecode lib@PVER@-stdlib@HOST_QUAL@
        # byte compilation in @PVER@ postinst, strict dependency
        ;;
    deconfigure)
        ;;
    failed-upgrade)
        ;;
    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#