File: python-h5py.preinst

package info (click to toggle)
h5py 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 12,372 kB
  • ctags: 25,779
  • sloc: python: 4,655; ansic: 700; makefile: 66; sh: 24
file content (28 lines) | stat: -rw-r--r-- 747 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
#!/bin/sh
# TODO: remove this file after releasing Squeeze
set -e

PYCENTRAL=/usr/bin/pycentral

if [ "$1" = upgrade ]
then
	if dpkg --compare-versions "$2" lt 1.3.0-3 ; then
		if [ -x $PYCENTRAL ]; then
			# explicitly remove old python-central files
			pycentral pkgremove python-h5py
		fi
	fi  
	# be really sure also removing left-over files and dirs
	# we do outside the previous 'if' since first pysupport
	# release was already distributed
	for pydir in site-packages dist-packages; do
		for pyversion in 2.4 2.5 2.6; do
			if [ -d /usr/lib/python$pyversion/$pydir/h5py/ ]; then
				rm -f /usr/lib/python$pyversion/$pydir/h5py/*
				rmdir --ignore-fail-on-non-empty /usr/lib/python$pyversion/$pydir/h5py/
			fi
		done
	done
fi

#DEBHELPER#