Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Make python3 default in 03-rewrite-pyton-shebang.sh hook
@ 2020-04-18 19:49 ahesford
  2020-04-18 19:49 ` xtraeme
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ahesford @ 2020-04-18 19:49 UTC (permalink / raw)
  To: ml

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

There is a new 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: 846 bytes --]

From b7809a4ec08d2b8377bb52fdf6a38ffcffed84c9 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 03-rewrite-python-shebang.sh hook

---
 common/hooks/pre-pkg/03-rewrite-python-shebang.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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:]]$')"

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-04-20 20:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 19:49 [PR PATCH] Make python3 default in 03-rewrite-pyton-shebang.sh hook ahesford
2020-04-18 19:49 ` xtraeme
2020-04-18 20:34 ` Chocimier
2020-04-20  1:25 ` [PR PATCH] [Updated] " ahesford
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

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).