All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] configure: Don't write .pyc files by default (python -B)
@ 2013-08-27 13:12 ` Stefan Weil
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Weil @ 2013-08-27 13:12 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: Stefan Weil

When a Python script is run, Python normally writes bytecode into a .pyc file.
QEMU's build process uses several Python scripts which are called from
configure or make.

The generated .pyc files take disk space without being of much use, because
those scripts are short, not time critical and only called a few times.

Python's option -B disables writing of .pyc files. QEMU now uses "python -B"
as default, but it is still possible to choose a different call by passing
--python=PYTHON to configure.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

It was necessary to change from "$python" to simply $python in the
Python test. This should not matter: we already have a simple $python
in configure, and Python wants to be installed in a path without
spaces.

Stefan

 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0a55c20..db69327 100755
--- a/configure
+++ b/configure
@@ -568,7 +568,7 @@ fi
 
 : ${make=${MAKE-make}}
 : ${install=${INSTALL-install}}
-: ${python=${PYTHON-python}}
+: ${python=${PYTHON-python -B}}
 : ${smbd=${SMBD-/usr/sbin/smbd}}
 
 # Default objcc to clang if available, otherwise use CC
@@ -1348,7 +1348,7 @@ fi
 
 # Note that if the Python conditional here evaluates True we will exit
 # with status 1 which is a shell 'false' value.
-if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then
+if ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then
   error_exit "Cannot use '$python', Python 2.4 or later is required." \
       "Note that Python 3 or later is not yet supported." \
       "Use --python=/path/to/python to specify a supported Python."
-- 
1.7.10.4



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

end of thread, other threads:[~2013-11-15  9:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 13:12 [Qemu-trivial] [PATCH] configure: Don't write .pyc files by default (python -B) Stefan Weil
2013-08-27 13:12 ` [Qemu-devel] " Stefan Weil
2013-09-01 15:15 ` [Qemu-trivial] " Michael Tokarev
2013-09-01 15:15   ` [Qemu-devel] " Michael Tokarev
2013-11-14 14:45 ` Stefan Hajnoczi
2013-11-14 14:45   ` [Qemu-devel] " Stefan Hajnoczi
2013-11-14 17:43   ` Stefan Weil
2013-11-14 17:43     ` [Qemu-devel] " Stefan Weil
2013-11-15  9:31     ` Stefan Hajnoczi
2013-11-15  9:31       ` [Qemu-devel] " Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.