[fedora-review] Fix rhbz912182

Stanislav Ochotnicky sochotni at fedoraproject.org
Tue Feb 19 13:33:07 UTC 2013


commit 327c40451b4beef856aadb383607efd5a54d080e
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Tue Feb 19 13:54:47 2013 +0100

    Fix rhbz912182
    
    - Reorganize patches a bit

 0001-Fix-syntax-error.patch                        |    8 +-
 ...Handle-characters-i-package-name-BZ908830.patch |    4 +-
 ...ocs-to-separate-doc-package-test-BZ-90883.patch |    4 +-
 ...NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch |    4 +-
 ...ock.init-is-invoked-before-other-usage-91.patch |   61 ++++++++++++++++++++
 0006-Ensure-we-run-correct-mock-binary.patch       |   24 ++++++++
 fedora-review.spec                                 |   25 ++++++--
 7 files changed, 114 insertions(+), 16 deletions(-)
---
diff --git a/0001-Fix-syntax-error.patch b/0001-Fix-syntax-error.patch
index e8dbf12..9b6fe01 100644
--- a/0001-Fix-syntax-error.patch
+++ b/0001-Fix-syntax-error.patch
@@ -1,12 +1,12 @@
-From 5aee7f3fcccf74a8f11b658d8ed047e104be3170 Mon Sep 17 00:00:00 2001
+From 847fb99ac78b4fd27b8adcc412ba49dc6cfd1cde Mon Sep 17 00:00:00 2001
 From: Ralph Bean <rbean at redhat.com>
 Date: Sun, 3 Feb 2013 14:31:21 -0500
 Subject: [PATCH 1/7] Fix syntax error.
 
 Signed-off-by: Alec Leamas <leamas.alec at gmail.com>
 ---
- src/fedora-create-review |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/fedora-create-review | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/fedora-create-review b/src/fedora-create-review
 index c7ef834..ed8fba3 100755
@@ -22,5 +22,5 @@ index c7ef834..ed8fba3 100755
                  self.username = fedora_cert.read_user_cert()
              except:
 -- 
-1.7.1
+1.8.1
 
diff --git a/0001-Handle-characters-i-package-name-BZ908830.patch b/0002-Handle-characters-i-package-name-BZ908830.patch
similarity index 91%
rename from 0001-Handle-characters-i-package-name-BZ908830.patch
rename to 0002-Handle-characters-i-package-name-BZ908830.patch
index 4d254ce..a029ba9 100644
--- a/0001-Handle-characters-i-package-name-BZ908830.patch
+++ b/0002-Handle-characters-i-package-name-BZ908830.patch
@@ -1,7 +1,7 @@
-From cffdb3c4b183538d832b72638395ba60ba3cfbf4 Mon Sep 17 00:00:00 2001
+From 9a168f86b5f292c539d7fd143e06272ddae97d68 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)
+Subject: [PATCH 2/7] 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
diff --git a/0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch b/0003-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
similarity index 90%
rename from 0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
rename to 0003-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
index 93f9898..833c92a 100644
--- a/0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
+++ b/0003-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
@@ -1,7 +1,7 @@
-From ed57b29f753be4c742ff80d586b70e13e74ab973 Mon Sep 17 00:00:00 2001
+From bc24b84869cbc84eb2f1003fd1495fb467bf6fe0 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
+Subject: [PATCH 3/7] Fix "large docs to separate -doc package" test (BZ
  908830).
 
 ---
diff --git a/0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch b/0004-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
similarity index 94%
rename from 0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
rename to 0004-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
index 9ebf9a0..a161b90 100644
--- a/0003-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
+++ b/0004-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
@@ -1,7 +1,7 @@
-From a9354dad902829d4cbf62d8b5a122285fb9d393a Mon Sep 17 00:00:00 2001
+From eac732ebd8977da7bb5c3e3fa95a1f7dc276f6b7 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
+Subject: [PATCH 4/7] Use REVIEW_NO_MOCKGROUP_TEST to inhibit test of mock
  group (#78)
 
 ---
diff --git a/0005-Make-sure-Mock.init-is-invoked-before-other-usage-91.patch b/0005-Make-sure-Mock.init-is-invoked-before-other-usage-91.patch
new file mode 100644
index 0000000..67e5083
--- /dev/null
+++ b/0005-Make-sure-Mock.init-is-invoked-before-other-usage-91.patch
@@ -0,0 +1,61 @@
+From 5b56e3599691129e3137ad3a0cb187c8c6b8aafa Mon Sep 17 00:00:00 2001
+From: Alec Leamas <alec at tests.notat.diaspora.com>
+Date: Mon, 18 Feb 2013 18:51:06 +0100
+Subject: [PATCH 5/7] Make sure Mock.init() is invoked before other usage
+ (#912182)
+
+---
+ src/FedoraReview/mock.py          | 9 ++++++++-
+ src/FedoraReview/review_helper.py | 2 ++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/src/FedoraReview/mock.py b/src/FedoraReview/mock.py
+index 6c5b6ae..3a4ae11 100644
+--- a/src/FedoraReview/mock.py
++++ b/src/FedoraReview/mock.py
+@@ -25,7 +25,7 @@ import os
+ import os.path
+ 
+ from glob import glob
+-from subprocess import call, Popen, PIPE, STDOUT
++from subprocess import call, Popen, PIPE, STDOUT, CalledProcessError
+ 
+ try:
+     from subprocess import check_output          # pylint: disable=E0611
+@@ -336,6 +336,13 @@ class _Mock(HelpersMixin):
+ 
+     def init(self):
+         """ Run a mock --init command. """
++        try:
++            self.rpm_eval('%{_libdir}')
++            self.log.debug("Avoiding init of working mock root")
++            return
++        except CalledProcessError:
++            pass
++        self.log.info("Re-initializing mock build root")
+         cmd = ["mock"]
+         if hasattr(Settings, 'mock_config') and Settings.mock_config:
+             cmd.extend(['-r', Settings.mock_config])
+diff --git a/src/FedoraReview/review_helper.py b/src/FedoraReview/review_helper.py
+index d3afe12..66e4dd1 100644
+--- a/src/FedoraReview/review_helper.py
++++ b/src/FedoraReview/review_helper.py
+@@ -25,6 +25,7 @@ import os.path
+ import ansi
+ from bugzilla_bug import BugzillaBug
+ from checks import Checks, ChecksLister
++from mock import Mock
+ from name_bug import NameBug
+ from review_dirs import ReviewDirs
+ from review_error import ReviewError
+@@ -73,6 +74,7 @@ class ReviewHelper(object):
+         if not ReviewDirs.is_inited:
+             wd = self.bug.get_dirname()
+             ReviewDirs.workdir_setup(wd)
++        Mock.init()
+ 
+         if not self.bug.download_files():
+             raise self.HelperError('Cannot download .spec and .srpm')
+-- 
+1.8.1
+
diff --git a/0006-Ensure-we-run-correct-mock-binary.patch b/0006-Ensure-we-run-correct-mock-binary.patch
new file mode 100644
index 0000000..029588a
--- /dev/null
+++ b/0006-Ensure-we-run-correct-mock-binary.patch
@@ -0,0 +1,24 @@
+From cda5e59118f1e41989683dc93809822b8cacce94 Mon Sep 17 00:00:00 2001
+From: Alec Leamas <alec at tests.notat.diaspora.com>
+Date: Mon, 18 Feb 2013 19:54:55 +0100
+Subject: [PATCH 7/7] Ensure we run correct mock binary
+
+---
+ make_release | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/make_release b/make_release
+index a7cfc81..079deb7 100755
+--- a/make_release
++++ b/make_release
+@@ -39,6 +39,7 @@ git reset --quiet --hard $commit
+ badlinks=$( find . -type l ! -execdir test -e '{}' \; -print | nl )
+ [ -n "$badlinks" ] && echo "Warning: unresolved  symlinks: $badlinks" >&2
+ 
++export PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ env PYTHONPATH=src ./update-version
+ 
+ source src/FedoraReview/version
+-- 
+1.8.1
+
diff --git a/fedora-review.spec b/fedora-review.spec
index 298c2b9..7a9b1ad 100644
--- a/fedora-review.spec
+++ b/fedora-review.spec
@@ -6,7 +6,7 @@
 
 Name:       fedora-review
 Version:    0.4.0
-Release:    3%{?git_tag}%{?dist}
+Release:    4%{?git_tag}%{?dist}
 Summary:    Review tool for fedora rpm packages
 
 License:    GPLv2+
@@ -35,13 +35,20 @@ Requires:       python-argparse
 provides:       FedoraReview = %{version}-%{release}
 
 # Applied upstream - 5aee7f3
-Patch0:         0001-Fix-syntax-error.patch
+Patch1:         0001-Fix-syntax-error.patch
 # Applied upstream - caeb135
-Patch1:         0001-Handle-characters-i-package-name-BZ908830.patch
+Patch2:         0002-Handle-characters-i-package-name-BZ908830.patch
 # Applied upstream - d7298ce
-Patch2:         0002-Fix-large-docs-to-separate-doc-package-test-BZ-90883.patch
+Patch3:         0003-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
+Patch4:         0004-Use-REVIEW_NO_MOCKGROUP_TEST-to-inhibit-test-of-mock.patch
+# Applied upstream - 1216801, #912182
+Patch5:         0005-Make-sure-Mock.init-is-invoked-before-other-usage-91.patch
+# Applied upstream - b493e1c
+Patch6:         0006-Ensure-we-run-correct-mock-binary.patch
+
+
+
 
 %description
 This tool automates much of the dirty work when reviewing a package
@@ -82,10 +89,12 @@ see http://php5.laurent-laville.org/compatinfo/.
 %prep
 %setup -q
 
-%patch0 -p1 -b .
 %patch1 -p1 -b .
 %patch2 -p1 -b .
 %patch3 -p1 -b .
+%patch4 -p1 -b .
+%patch5 -p1 -b .
+%patch6 -p1 -b .
 
 %build
 %{__python} setup.py --quiet build
@@ -137,6 +146,10 @@ python -m unittest discover -f
 
 
 %changelog
+* Tue Feb 19 2013 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.4.0-4
+- Fix rhbz912182
+- Reorganize patches a bit
+
 * 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


More information about the scm-commits mailing list