From 86a7924cebf01fca0098766876f458617228e4d2 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 20 Feb 2009 18:38:44 +0000 Subject: [PATCH] - error out on uncompilable python code (Tim Waugh) --- rpm-4.6.0-python-validate.patch | 17 +++++++++++++++++ rpm.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 rpm-4.6.0-python-validate.patch diff --git a/rpm-4.6.0-python-validate.patch b/rpm-4.6.0-python-validate.patch new file mode 100644 index 0000000..61d9873 --- /dev/null +++ b/rpm-4.6.0-python-validate.patch @@ -0,0 +1,17 @@ +diff -up rpm-4.6.0/scripts/brp-python-bytecompile.validate rpm-4.6.0/scripts/brp-python-bytecompile +--- rpm-4.6.0/scripts/brp-python-bytecompile.validate 2009-02-20 20:31:30.000000000 +0200 ++++ rpm-4.6.0/scripts/brp-python-bytecompile 2009-02-20 20:31:37.000000000 +0200 +@@ -20,7 +20,12 @@ if [ -z "$depth" -o "$depth" -le "1" ]; + fi + + # Generate normal (.pyc) byte-compiled files. +-$python -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null ++$python -c 'import compileall, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1, quiet=1))' ++if [ $? != 0 ]; then ++ # One or more of the files has a syntax error. ++ exit 1 ++fi ++ + + # Generate optimized (.pyo) byte-compiled files. + $python -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null diff --git a/rpm.spec b/rpm.spec index 2930a05..0719829 100644 --- a/rpm.spec +++ b/rpm.spec @@ -18,7 +18,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: 5%{?dist} +Release: 6%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2 @@ -42,6 +42,7 @@ Patch202: rpm-4.6.0-anyarch-actions-fix.patch # These are not yet upstream Patch300: rpm-4.6.0-extra-provides.patch +Patch301: rpm-4.6.0-python-validate.patch # Partially GPL/LGPL dual-licensed and some bits with BSD # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD @@ -178,6 +179,7 @@ that will manipulate RPM packages and databases. %patch202 -p1 -b .anyarch-actions-fix %patch300 -p1 -b .extra-prov +%patch301 -p1 -b .python-bytecompile %if %{with int_bdb} ln -s db-%{bdbver} db @@ -377,6 +379,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Fri Feb 20 2009 Panu Matilainen - 4.6.0-6 +- error out on uncompilable python code (Tim Waugh) + * Tue Feb 17 2009 Jindrich Novy - 4.6.0-5 - remove two offending hunks from anyarch patch causing that RPMTAG_BUILDARCHS isn't written to SRPMs