GNU bug report logs - #74434
[PATCH] py-compile: Allow user to disable python

Previous Next

Package: automake-patches;

Reported by: Frédéric Bérat <fberat <at> redhat.com>

Date: Tue, 19 Nov 2024 09:55:02 UTC

Severity: normal

Tags: patch

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Frédéric Bérat <fberat <at> redhat.com>
To: 74434 <at> debbugs.gnu.org
Subject: [bug#74434] [PATCH] py-compile: Allow user to disable python
Date: Tue, 19 Nov 2024 10:52:02 +0100
Hello,

While integrating automake 1.17, I found that otf2 package build fails.
The failure is due to:
	py-compile: could not determine : major version

This is a side-effect of a rework of the py-compile script, which
formerly defaulted to python3 if there was an error while getting the
python version.

The new code doesn't have this fallback, and if users want to disable
python support by setting `PYTHON=:` as environment variable, the script
bails out.

I believe this is a common practice and that py-compile needs a fix. I
therefore propose the one below.

Feel free to tell me otherwise.

Fred.

-- 8< --
Subject: [PATCH] py-compile: Allow user to disable python

Common practice is to set PYTHON=: to disable python support, which
breaks the current version of this script.

Check that the PYTHON variable contains `python`, early exit otherwise.
---
 lib/py-compile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/py-compile b/lib/py-compile
index c9d4fde94..0238bab2c 100755
--- a/lib/py-compile
+++ b/lib/py-compile
@@ -33,6 +33,13 @@ fi
 
 me=py-compile
 
+case "$PYTHON" in
+  *python*) ;;
+  *)
+  echo "$me: Python support disabled";
+  exit 0;;
+esac
+
 usage_error ()
 {
   echo "$me: $*" >&2
-- 
2.47.0





This bug report was last modified 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.