public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - error out on uncompilable python code (Tim Waugh)
Date: Mon, 23 Nov 2026 09:25:37 GMT	[thread overview]
Message-ID: <179542593716.1.13969920569480341371.rpms-rpm-86a7924cebf0@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 86a7924cebf01fca0098766876f458617228e4d2
Author : Panu Matilainen <pmatilai@fedoraproject.org>
Date   : 2009-02-20T18:38:44+00:00
Stats  : +23/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/86a7924cebf01fca0098766876f458617228e4d2?branch=pmatilai-v6

Log:
- error out on uncompilable python code (Tim Waugh)

---
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 <pmatilai@redhat.com> - 4.6.0-6
+- error out on uncompilable python code (Tim Waugh)
+
 * Tue Feb 17 2009 Jindrich Novy <jnovy@redhat.com> - 4.6.0-5
 - remove two offending hunks from anyarch patch causing that
   RPMTAG_BUILDARCHS isn't written to SRPMs

                 reply	other threads:[~2026-11-23  9:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542593716.1.13969920569480341371.rpms-rpm-86a7924cebf0@fedoraproject.org \
    --to=pmatilai@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox