File: calibre.postinst

package info (click to toggle)
calibre 3.39.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 389,072 kB
  • sloc: python: 399,008; ansic: 87,939; xml: 42,470; cpp: 41,124; sh: 802; sql: 577; makefile: 69
file content (32 lines) | stat: -rw-r--r-- 710 bytes parent folder | download
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
#!/bin/sh

set -eu

#
# deal with .py[co] files that are left overs from pre-pycompile switch
# since we drop regexp etc files

case "$1" in
  configure|reconfigure)

  old_version=$2

  if [ -n "$old_version" ] && dpkg --compare-versions "$old_version" lt "3.4.0+dfsg-2"; then
    find /usr/lib/calibre -name \*.pyc -o -name \*.pyo | while read file ; do
      rm "${file}"
    done
    # regex directory was there but disappeared, try to remove it
    # now that all the pyc files should be gone.
    if [ -d /usr/lib/calibre/regex ] ; then
      rmdir /usr/lib/calibre/regex
    fi
  fi
  ;;
esac


if which pycompile >/dev/null 2>&1; then
  pycompile -p calibre /usr/lib/calibre -V 2.7-2.9
fi

#DEBHELPER#