[bcfg2: 11/16] Replace disable_tests patch with awk script
John Morris
zultron at fedoraproject.org
Sat Nov 23 20:59:23 UTC 2013
commit 86c44460e655e84539de35b3fd9039f3b27279b9
Author: John Morris <john at zultron.com>
Date: Tue Aug 6 16:25:56 2013 -0500
Replace disable_tests patch with awk script
This is cleaner to include in the upstream code tree.
bcfg2-1.3.2.disable_tests.patch | 21 ---------------------
bcfg2.spec | 14 +++++++++++---
2 files changed, 11 insertions(+), 24 deletions(-)
---
diff --git a/bcfg2.spec b/bcfg2.spec
index 184eee6..e008567 100644
--- a/bcfg2.spec
+++ b/bcfg2.spec
@@ -25,8 +25,6 @@ Source1: ftp://ftp.mcs.anl.gov/pub/bcfg/bcfg2-%{version}%{?_pre_rc}.tar
# Used in %%check
Source2: http://www.w3.org/2001/XMLSchema.xsd
Source3: http://www.w3.org/2001/xml.xsd
-# Pylint fails on all RedHat distros; reported upstream 2013-07-03
-Patch0: bcfg2-1.3.2.disable_tests.patch
%if 0%{?rhel} == 5
# EL5 requires the BuildRoot tag
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -328,7 +326,17 @@ This package includes the examples files for Bcfg2.
%prep
%setup -q -n %{name}-%{version}%{?_pre_rc}
-%patch0 -p1 -b .disable_tests
+
+# The pylint and pep8 unit tests fail on RH-derivative distros
+mv testsuite/Testsrc/test_code_checks.py \
+ testsuite/Testsrc/test_code_checks.py.disable_unit_tests
+awk '
+ BEGIN {line=0}
+ /class Test(Pylint|PEP8)/ {line=FNR+1}
+ FNR==line {sub("True","False")}
+ {print $0}
+ ' testsuite/Testsrc/test_code_checks.py.disable_unit_tests \
+ > testsuite/Testsrc/test_code_checks.py
# Fixup some paths
%{__perl} -pi -e 's@/etc/default@%{_sysconfdir}/sysconfig at g' tools/bcfg2-cron
More information about the scm-commits
mailing list