aboutsummaryrefslogtreecommitdiff
path: root/common
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
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')
-rw-r--r--common/environment/setup-subpkg/subpkg.sh2
-rw-r--r--common/hooks/post-install/04-create-xbps-metadata-scripts.sh12
2 files changed, 12 insertions, 2 deletions
diff --git a/common/environment/setup-subpkg/subpkg.sh b/common/environment/setup-subpkg/subpkg.sh
index 6bf748fdc3d..0243d240048 100644
--- a/common/environment/setup-subpkg/subpkg.sh
+++ b/common/environment/setup-subpkg/subpkg.sh
@@ -27,7 +27,7 @@ unset -v font_dirs
unset -v xml_entries sgml_entries xml_catalogs sgml_catalogs
# xbps-triggers: pycompile
-unset -v pycompile_version pycompile_dirs pycompile_module
+unset -v pycompile_dirs pycompile_module
# xbps-triggers: dkms
unset -v dkms_modules
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