aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
authorPiotr Wójcik <chocimier@tlen.pl>2020-04-20 17:22:10 +0000
committerPiotr <chocimier@tlen.pl>2020-04-22 18:11:26 +0000
commit8a09d89eacf72d4a09df5835cf458ad55f135caa (patch)
tree8398f2cc10b17b7da44a1c035993780d709f960e /common/hooks
parent6c6ab14604b52cb50821a936b8bd837a89fcb240 (diff)
downloadvoid-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar.gz
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar.bz2
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar.lz
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar.xz
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.tar.zst
void-packages-8a09d89eacf72d4a09df5835cf458ad55f135caa.zip
common/hooks: remove pycompile_version, use python_version instead
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