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