Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Make python3 default in 03-rewrite-pyton-shebang.sh hook
Date: Mon, 20 Apr 2020 03:25:58 +0200	[thread overview]
Message-ID: <20200420012558.etTx6mFOLg1TCLmmFh-g5QdLPN5lmOCh_vUuBOHJAa8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21132@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

There is an updated pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages hooks
https://github.com/void-linux/void-packages/pull/21132

Make python3 default in 03-rewrite-pyton-shebang.sh hook
The `03-rewrite-python-shebang.sh` hook assumes `python2` by default, overriding only if `python_version` or `pycompile_version` are set, or the package installs some modules in `/usr/lib/python*`.

Not all packages that install Python scripts set these variables or install modules, so the shebang is forced to `python2` by default. Because `python2` is EOL, I think it is sensible to assume these packages are doing the right thing and targeting `python3` instead.

A patch file from https://github.com/void-linux/void-packages/pull/21132.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-hooks-21132.patch --]
[-- Type: text/x-diff, Size: 2114 bytes --]

From b8fac295f40567be5f863be17c67dee9e42eccb5 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
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:]]$')"

  parent reply	other threads:[~2020-04-20  1:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 19:49 [PR PATCH] " ahesford
2020-04-18 19:49 ` xtraeme
2020-04-18 20:34 ` Chocimier
2020-04-20  1:25 ` ahesford [this message]
2020-04-20  1:27 ` ahesford
2020-04-20  1:32 ` Make python3 default in XBPS environment and hooks q66
2020-04-20  2:03 ` ahesford
2020-04-20  2:21 ` q66
2020-04-20 18:11 ` Chocimier
2020-04-20 20:12 ` [PR PATCH] [Closed]: " ahesford
2020-04-20 20:12 ` ahesford
2020-04-20 20:13 ` ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200420012558.etTx6mFOLg1TCLmmFh-g5QdLPN5lmOCh_vUuBOHJAa8@z \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).