Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] option to skip 03-rewrite-python-shebang
@ 2021-11-13 11:20 tornaria
  2021-11-13 14:03 ` ericonr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tornaria @ 2021-11-13 11:20 UTC (permalink / raw)
  To: ml

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

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages rewrite-python-shebang
https://github.com/void-linux/void-packages/pull/34053

[RFC] option to skip 03-rewrite-python-shebang
For #34030 we need to disable `pre-pkg/03-rewrite-python-shebang`, since sagemath ships its own python and rewriting shebangs breaks it (we will work on un-vendoring python, but that's a different story).

This PR adds an option `no_python_shebang=yes` to skip running this hook, similar to `nocross=yes`.

If this goes through, it will have to be added to `Manual.md` and to `xlint`, but I want to get feedback before.

Maybe, as an alternative, a way to skip hooks by name would be more generally useful? Something like `skip_hook="pre-pkg/03-rewrite-python-shebang"` with a space separated list of hooks to skip. That shouldn't be too hard to implement in `run_pkg_hooks()`.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rewrite-python-shebang-34053.patch --]
[-- Type: text/x-diff, Size: 878 bytes --]

From a1734b6383b915fce0d296324bf0c4d6cda3e930 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 11 Nov 2021 09:39:20 -0300
Subject: [PATCH] hooks: option to skip 03-rewrite-python-shebang

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

diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
index 07162ad2c69b..0ac9d7dda65a 100644
--- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
+++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh
@@ -4,6 +4,10 @@
 hook() {
 	local pyver= shebang= off=
 
+	if [ -n "$no_python_shebang" ]; then
+		return 0
+	fi
+
 	if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then
 		pyver="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]\+$')"
 	fi

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

end of thread, other threads:[~2021-11-15  1:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-13 11:20 [PR PATCH] [RFC] option to skip 03-rewrite-python-shebang tornaria
2021-11-13 14:03 ` ericonr
2021-11-14 10:18 ` dkwo
2021-11-14 14:27 ` leahneukirchen
2021-11-14 14:48 ` tornaria
2021-11-14 18:31 ` ericonr
2021-11-15  1:45 ` [PR PATCH] [Closed]: " tornaria
2021-11-15  1:45 ` tornaria

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