Blame SOURCES/redhat-rpm-config-9.1.0-strict-python-bytecompile.patch

eaaa62
commit 7cf1ad2dbb5af9b9012ba67b9687ad28c02578d6
eaaa62
Author: Panu Matilainen <pmatilai@redhat.com>
eaaa62
Date:   Wed Feb 3 12:52:30 2010 +0200
eaaa62
eaaa62
    Enable strict python bytecompile mode (if rpm supports it)
eaaa62
    - with %_python_bytecompile_errors_terminate_build set to non-zero,
eaaa62
      byte-compilation errors will abort the build, this helps catch out
eaaa62
      silly "improt foo" syntax errors early on
eaaa62
    - not all .py files are valid python (they can be templates, inteded for
eaaa62
      jython consumption etc), and what's valid can depend on the python
eaaa62
      version (notably 2.x vs 3.x) so allow overriding from spec
eaaa62
eaaa62
diff --git a/macros b/macros
eaaa62
index 77844f0..7721fe0 100644
eaaa62
--- a/macros
eaaa62
+++ b/macros
eaaa62
@@ -95,7 +95,7 @@
eaaa62
     %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \
eaaa62
     /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
eaaa62
     /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
eaaa62
-    /usr/lib/rpm/brp-python-bytecompile %{__python} \
eaaa62
+    /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \
eaaa62
     /usr/lib/rpm/redhat/brp-python-hardlink \
eaaa62
     %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
eaaa62
 %{nil}
eaaa62
@@ -167,6 +167,10 @@ unset DISPLAY\
eaaa62
 # Should unpackaged files in a build root terminate a build?
eaaa62
 %_unpackaged_files_terminate_build    1
eaaa62
 
eaaa62
+#
eaaa62
+## Should python bytecompilation errors terminate a build?
eaaa62
+%_python_bytecompile_errors_terminate_build 1
eaaa62
+
eaaa62
 # Use SHA-256 for FILEDIGESTS instead of default MD5
eaaa62
 %_source_filedigest_algorithm 8
eaaa62
 %_binary_filedigest_algorithm 8