[fedora-review] Fix rhbz908830 and rhbz908830
Stanislav Ochotnicky
sochotni at fedoraproject.org
Fri Feb 8 13:41:04 UTC 2013
commit 4ce9f386be53fdcfa0d6840fb52bc64ac19cbbb5
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date: Fri Feb 8 14:40:15 2013 +0100
Fix rhbz908830 and rhbz908830
- Add patch for REVIEW_NO_MOCKGROUP_TEST environment variable
- Remove old patch
...Handle-characters-i-package-name-BZ908830.patch | 40 +++++++++++++
...andle-multiline-envvars-correct-bz-874246.patch | 28 ---------
...ocs-to-separate-doc-package-test-BZ-90883.patch | 40 +++++++++++++
...NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch | 60 ++++++++++++++++++++
fedora-review.spec | 20 +++++-
5 files changed, 156 insertions(+), 32 deletions(-)
---
diff --git a/0001-Handle-characters-i-package-name-BZ908830.patch b/0001-Handle-characters-i-package-name-BZ908830.patch
new file mode 100644
index 0000000..4d254ce
--- /dev/null
+++ b/0001-Handle-characters-i-package-name-BZ908830.patch
@@ -0,0 +1,40 @@
+From cffdb3c4b183538d832b72638395ba60ba3cfbf4 Mon Sep 17 00:00:00 2001
+From: Alec Leamas <leamas.alec at gmail.com>
+Date: Fri, 8 Feb 2013 11:39:09 +0100
+Subject: [PATCH 1/3] Handle '+' characters i package name (BZ908830)
+
+Caused a crash when a package named *c++* was fed to a regex which
+tried to interpret the '+' characters. No other regex reserved
+chars [\^$.|?*() should realistically be in package names(?). There
+may be other places affected by this, though.
+
+Conflicts:
+ plugins/generic.py
+---
+ plugins/generic.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/generic.py b/plugins/generic.py
+index f2d8235..21ccbb0 100644
+--- a/plugins/generic.py
++++ b/plugins/generic.py
+@@ -226,9 +226,14 @@ class CheckCleanBuildroot(GenericCheckBase):
+
+ def run(self):
+ has_clean = False
+- regex = 'rm\s+\-[rf][rf]\s+(%{buildroot}|$RPM_BUILD_ROOT)'
+- regex = rpm.expandMacro(regex)
++ regex = r'rm\s+\-[rf][rf]\s+(@buildroot@|$RPM_BUILD_ROOT)'
++ buildroot = rpm.expandMacro('%{buildroot}')
++ # BZ 908830: handle '+' in package name.
++ buildroot = buildroot.replace('+', r'\+')
++ regex = regex.replace('@buildroot@', buildroot)
+ install_sec = self.spec.get_section('%install', raw=True)
++ self.log.debug('regex: ' + regex)
++ self.log.debug('install_sec: ' + install_sec)
+ has_clean = install_sec and re.search(regex, install_sec)
+ if self.flags['EPEL5']:
+ self.text = 'EPEL5: Package does run rm -rf %{buildroot}' \
+--
+1.8.1
+
diff --git a/0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch b/0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
new file mode 100644
index 0000000..93f9898
--- /dev/null
+++ b/0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
@@ -0,0 +1,40 @@
+From ed57b29f753be4c742ff80d586b70e13e74ab973 Mon Sep 17 00:00:00 2001
+From: Alec Leamas <leamas.alec at gmail.com>
+Date: Fri, 8 Feb 2013 12:20:18 +0100
+Subject: [PATCH 2/3] Fix "large docs to separate -doc package" test (BZ
+ 908830).
+
+---
+ scripts/check-large-docs.sh | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/check-large-docs.sh b/scripts/check-large-docs.sh
+index 2f598aa..1870284 100755
+--- a/scripts/check-large-docs.sh
++++ b/scripts/check-large-docs.sh
+@@ -4,18 +4,19 @@
+ # @url: http://fedoraproject.org/wiki/Packaging/Guidelines#PackageDocumentation
+ # @text: Large documentation must go in a -doc subpackage.
+
+-
+ min=10000
+ max=1000000
+ docdir='./usr/share/doc'
+
+ if unpack_rpms; then
+ size=$(for rpm in rpms-unpacked/*; do
+- [[ $rpm = *doc ]] && continue
++ [[ $rpm = *-doc-* ]] && continue
++ [[ $rpm = *-javadoc-* ]] && continue
+ (cd $rpm; test -d $docdir && tar c $docdir)
+ done | wc -c)
+ count=$(for rpm in rpms-unpacked/*; do
+- [[ $rpm = *doc ]] && continue
++ [[ $rpm = *-doc-* ]] && continue
++ [[ $rpm = *-javadoc-* ]] && continue
+ (cd $rpm; test -d $docdir && find $docdir -type f)
+ done | wc -l)
+
+--
+1.8.1
+
diff --git a/0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch b/0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
new file mode 100644
index 0000000..9ebf9a0
--- /dev/null
+++ b/0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
@@ -0,0 +1,60 @@
+From a9354dad902829d4cbf62d8b5a122285fb9d393a Mon Sep 17 00:00:00 2001
+From: Alec Leamas <leamas.alec at gmail.com>
+Date: Fri, 8 Feb 2013 13:45:13 +0100
+Subject: [PATCH 3/3] Use REVIEW_NO_MOCKGROUP_TEST to inhibit test of mock
+ group (#78)
+
+---
+ fedora-review.1 | 5 +++++
+ src/FedoraReview/settings.py | 11 +++++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/fedora-review.1 b/fedora-review.1
+index 45542f6..c575a52 100644
+--- a/fedora-review.1
++++ b/fedora-review.1
+@@ -285,6 +285,11 @@ User supplied directory with shell-based plugins
+ loglevel used when not using -v/--verbose. A logging.* value like 'DEBUG', 'Info', or 'warning'. Setting
+ REVIEW_LOGLEVEL to 'debug' is the same as providing the -v/--verbose option.
+ .TP
++.B REVIEW_NO_MOCKGROUP_CHECK
++Normally, fedora-review checks that user is member of the mock group
++before proceeding since this is required to run mock in most setups.
++In cases this check is not useful it can be suppressed by this variable.
++.TP
+ .B XDG_DATA_HOME
+ fedora-review respects XDG_DATA_HOME which defaults to ~/.local/share. Eg g.,
+ the personal data directory with plugins is by default ~/.local/share/fedora-review/plugins,
+diff --git a/src/FedoraReview/settings.py b/src/FedoraReview/settings.py
+index 86cc2bd..81d94a3 100644
+--- a/src/FedoraReview/settings.py
++++ b/src/FedoraReview/settings.py
+@@ -16,9 +16,9 @@
+ #
+ # (C) 2011 - Tim Lauridsen <timlau at fedoraproject.org>
+
+-'''
+-Tools for helping Fedora package reviewers
+-'''
++''' Tools for helping Fedora package reviewers '''
++
++# pylint: disable=R0924
+
+ import argparse
+ import grp
+@@ -44,8 +44,11 @@ def _check_mock_grp():
+ mock_msg = \
+ 'No mock group - mock not installed or mock not in effective' \
+ 'groups. Try running "newgrp" or logging out from all your local '\
+- 'sessions and logging back in.'
++ 'sessions and logging back in. Or disable test using ' \
++ 'REVIEW_NO_MOCKGROUP_CHECK, see manpage'
+
++ if 'REVIEW_NO_MOCKGROUP_CHECK' in os.environ:
++ return
+ mock_gid = grp.getgrnam('mock')[2]
+ if not mock_gid in os.getgroups():
+ raise ReviewError(mock_msg)
+--
+1.8.1
+
diff --git a/fedora-review.spec b/fedora-review.spec
index 78482da..298c2b9 100644
--- a/fedora-review.spec
+++ b/fedora-review.spec
@@ -6,7 +6,7 @@
Name: fedora-review
Version: 0.4.0
-Release: 2%{?git_tag}%{?dist}
+Release: 3%{?git_tag}%{?dist}
Summary: Review tool for fedora rpm packages
License: GPLv2+
@@ -35,7 +35,13 @@ Requires: python-argparse
provides: FedoraReview = %{version}-%{release}
# Applied upstream - 5aee7f3
-Patch0: 0001-Fix-syntax-error.patch
+Patch0: 0001-Fix-syntax-error.patch
+# Applied upstream - caeb135
+Patch1: 0001-Handle-characters-i-package-name-BZ908830.patch
+# Applied upstream - d7298ce
+Patch2: 0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
+# Applied upstream - d7aab9e
+Patch3: 0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
%description
This tool automates much of the dirty work when reviewing a package
@@ -77,6 +83,9 @@ see http://php5.laurent-laville.org/compatinfo/.
%setup -q
%patch0 -p1 -b .
+%patch1 -p1 -b .
+%patch2 -p1 -b .
+%patch3 -p1 -b .
%build
%{__python} setup.py --quiet build
@@ -128,6 +137,11 @@ python -m unittest discover -f
%changelog
+* Fri Feb 8 2013 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.4.0-3
+- Fix rhbz908830 and rhbz908830
+- Add patch for REVIEW_NO_MOCKGROUP_TEST environment variable
+- Remove old patch
+
* Mon Feb 04 2013 Pierre-Yves Chibon <pingou at pingoured.fr> - 0.4.0-2
- Add Patch0 (0001-Fix-syntax-error.patch) from Ralph Bean fixing fedora-create-review
@@ -180,5 +194,3 @@ python -m unittest discover -f
* Thu Nov 10 2011 Pierre-Yves Chibon <pingou at pingoured.fr> - 0.1.0-1
- Initial packaging work for Fedora
-
-
More information about the scm-commits
mailing list