summaryrefslogtreecommitdiff
path: root/autoscripts/postinst-python
diff options
context:
space:
mode:
authorjoey <joey>2002-12-09 17:21:33 +0000
committerjoey <joey>2002-12-09 17:21:33 +0000
commitc77a36f731a5de1b01a65dc32ca19b22deddbde2 (patch)
treeacaa747ecd98bea485f97bfa895d092f1887171a /autoscripts/postinst-python
parent0603748a9eff14666bd5f8e0f2983565684d324d (diff)
r568: * Fixed dh_python ordering in example rules files. Closes: #172283
* Make python postinst fragment only run python if it is installed, useful for packages that include python modules but do not depend on python.
Diffstat (limited to 'autoscripts/postinst-python')
-rw-r--r--autoscripts/postinst-python12
1 files changed, 7 insertions, 5 deletions
diff --git a/autoscripts/postinst-python b/autoscripts/postinst-python
index 2ecb99b..6f1f9a5 100644
--- a/autoscripts/postinst-python
+++ b/autoscripts/postinst-python
@@ -1,6 +1,8 @@
PYTHON=#PYVER#
-DIRLIST="#DIRLIST#"
-for i in $DIRLIST ; do
- $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $i
- $PYTHON /usr/lib/$PYTHON/compileall.py -q $i
-done
+if which $PYTHON >/dev/null 2>&1; then
+ DIRLIST="#DIRLIST#"
+ for i in $DIRLIST ; do
+ $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $i
+ $PYTHON /usr/lib/$PYTHON/compileall.py -q $i
+ done
+fi