summaryrefslogtreecommitdiff
path: root/debian/PVER-venv.postinst.in
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-09-29 13:40:02 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-09-29 13:40:02 +0300
commit424a50000a78fff715de4417dba9b4498aeeee4c (patch)
treed27f003c7d140fef24efd1b2ca1325ae099154b9 /debian/PVER-venv.postinst.in
downloadpython3.5-424a50000a78fff715de4417dba9b4498aeeee4c.tar.gz
Imported python3.5 3.5.4-4debian/3.5.4-4debian
Diffstat (limited to 'debian/PVER-venv.postinst.in')
-rw-r--r--debian/PVER-venv.postinst.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/PVER-venv.postinst.in b/debian/PVER-venv.postinst.in
new file mode 100644
index 0000000..a830485
--- /dev/null
+++ b/debian/PVER-venv.postinst.in
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+ configure)
+ files=$(dpkg -L @PVER@-venv | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p')
+ if [ -n "$files" ]; then
+ /usr/bin/@PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files
+ if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
+ /usr/bin/@PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files
+ fi
+ else
+ echo >&2 "@PVER@: can't get files for byte-compilation"
+ fi
+esac
+
+#DEBHELPER#
+
+exit 0