aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'common/hooks')
-rw-r--r--common/hooks/post-install/04-create-xbps-metadata-scripts.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
index 3b1089cd410..0d9797469b2 100644
--- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
+++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh
@@ -258,6 +258,7 @@ _EOF
#
# Handle python bytecode archives with pycompile trigger.
#
+ local pycompile_version
if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then
pycompile_version="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]$')"
if [ -z "${pycompile_module}" ]; then
@@ -265,8 +266,17 @@ _EOF
fi
fi
+ if [ -n "$python_version" ]; then
+ pycompile_version=${python_version}
+ fi
+
+ if [ "$pycompile_version" = 3 ]; then
+ pycompile_version=${py3_ver}
+ fi
+
if [ -n "${pycompile_dirs}" -o -n "${pycompile_module}" ]; then
- echo "export pycompile_version=\"${pycompile_version:=2.7}\"" >>$tmpf
+ [ -n "$pycompile_version" ] || msg_error "$pkgver: byte-compilation is required, but python_version is not set\n"
+ echo "export pycompile_version=\"${pycompile_version}\"" >>$tmpf
if [ -n "${pycompile_dirs}" ]; then
echo "export pycompile_dirs=\"${pycompile_dirs}\"" >>$tmpf
fi