From b8fac295f40567be5f863be17c67dee9e42eccb5 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Sat, 18 Apr 2020 15:42:46 -0400 Subject: [PATCH] Make python3 default in XBPS environment and hooks --- common/environment/setup/python.sh | 4 ++-- common/hooks/post-install/04-create-xbps-metadata-scripts.sh | 2 +- common/hooks/pre-pkg/03-rewrite-python-shebang.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/environment/setup/python.sh b/common/environment/setup/python.sh index ba181d45361..60f235b968c 100644 --- a/common/environment/setup/python.sh +++ b/common/environment/setup/python.sh @@ -2,8 +2,8 @@ # Useful variables for determining Python version and paths. # -# set version 2 as the default Python -python_version="2" +# set version 3 as the default Python +python_version="3" py2_ver="2.7" py2_lib="/usr/lib/python${py2_ver}" 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..83d172d0abe 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -266,7 +266,7 @@ _EOF fi if [ -n "${pycompile_dirs}" -o -n "${pycompile_module}" ]; then - echo "export pycompile_version=\"${pycompile_version:=2.7}\"" >>$tmpf + echo "export pycompile_version=\"${pycompile_version:=3.8}\"" >>$tmpf if [ -n "${pycompile_dirs}" ]; then echo "export pycompile_dirs=\"${pycompile_dirs}\"" >>$tmpf fi diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh index 4de75da2a76..7114143b73d 100644 --- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh +++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh @@ -4,7 +4,7 @@ hook() { local pyver= shebang= off= - : ${pyver:=2} + : ${pyver:=3} if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then pyver="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]$')"