File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020set -e
2121CLOUDUTILS_DIR=" /usr/share/pyshared/"
22- DIST_DIR=$( python3 -c " from distutils.sysconfig import get_python_lib; print(get_python_lib(1))" )
2322
24- if which pycompile > /dev/null 2>&1 ; then
25- pycompile -p cloudstack-common || echo " Warning: pycompile failed for cloudstack-common " >&2
26- fi
23+ # distutils was removed in Python 3.12 (Ubuntu 24.04); the Debian/Ubuntu-patched
24+ # sysconfig 'deb_system' scheme gives the same /usr/lib/python3/dist-packages path.
25+ DIST_DIR= $( python3 -c " import sysconfig; print(sysconfig.get_path('platlib', 'deb_system')) " )
2726
28- if which pycompile > /dev/null 2>&1 ; then
29- pycompile -p cloudstack-common /usr/share/cloudstack-common || true
27+ if command -v py3compile > /dev/null 2>&1 ; then
28+ py3compile -p cloudstack-common 2> /dev/null || echo " Warning: py3compile failed for cloudstack-common" >&2
29+ py3compile -p cloudstack-common /usr/share/cloudstack-common 2> /dev/null || echo " Warning: py3compile failed for cloudstack-common (/usr/share/cloudstack-common)" >&2
3030fi
3131
3232cp $CLOUDUTILS_DIR /cloud_utils.py $DIST_DIR
You can’t perform that action at this time.
0 commit comments