~ubuntu-branches/ubuntu/raring/python3.3/raring-proposed

« back to all changes in this revision

Viewing changes to debian/PVER-dbg.prerm.in

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-22 06:14:01 UTC
  • Revision ID: package-import@ubuntu.com-20120322061401-vvrgvw3nvi68rtqq
Tags: 3.3.0~a1-1
* Python 3.3.0 alpha1 release.
* Update to 20120321 from the trunk.
* Update debian/copyright.
* Build-depend on expat (>= 2.1~).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
remove_bytecode()
 
6
{
 
7
    pkg=$1
 
8
    max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}')
 
9
    dpkg -L $pkg \
 
10
        | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
 
11
        | xargs --max-chars=$max echo \
 
12
        | while read files; do rm -f $files; done
 
13
    if [ -d /usr/bin/__pycache__ ]; then
 
14
        rmdir --ignore-fail-on-non-empty /usr/bin/__pycache__
 
15
    fi
 
16
}
 
17
 
 
18
case "$1" in
 
19
    remove)
 
20
        remove_bytecode @PVER@-dbg
 
21
        ;;
 
22
    upgrade)
 
23
        remove_bytecode @PVER@-dbg
 
24
        ;;
 
25
    deconfigure)
 
26
        ;;
 
27
    failed-upgrade)
 
28
        ;;
 
29
    *)
 
30
        echo "prerm called with unknown argument \`$1'" >&2
 
31
        exit 1
 
32
    ;;
 
33
esac
 
34
 
 
35
#DEBHELPER#