[bzr] Patch for failure to gpg sign commits with no gpg-agent

Toshio くらとみ toshio at fedoraproject.org
Wed May 29 00:58:58 UTC 2013


commit 52a515a856c32b1c6a113d9319a0e3a6051c2474
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Tue May 28 17:58:34 2013 -0700

    Patch for failure to gpg sign commits with no gpg-agent
    
      https://bugzilla.redhat.com/show_bug.cgi?id=905087

 bzr-2.5b5-fix_sphinx11_texinfo.patch |   11 -------
 bzr-gpg-no-agent-error.patch         |   44 +++++++++++++++++++++++++++
 bzr.dev-5439-python27.patch          |   55 ----------------------------------
 bzr.spec                             |    8 +++++
 4 files changed, 52 insertions(+), 66 deletions(-)
---
diff --git a/bzr-gpg-no-agent-error.patch b/bzr-gpg-no-agent-error.patch
new file mode 100644
index 0000000..8ed6f4e
--- /dev/null
+++ b/bzr-gpg-no-agent-error.patch
@@ -0,0 +1,44 @@
+Index: bzr-2.5.1/bzrlib/gpg.py
+===================================================================
+--- bzr-2.5.1.orig/bzrlib/gpg.py
++++ bzr-2.5.1/bzrlib/gpg.py
+@@ -190,7 +190,7 @@ class GPGStrategy(object):
+             # use the user email address
+             key = config.extract_email_address(self._config_stack.get('email'))
+         return [self._config_stack.get('gpg_signing_command'), '--clearsign',
+-                '-u', key, '--no-tty']
++                '-u', key]
+ 
+     def sign(self, content):
+         if isinstance(content, unicode):
+Index: bzr-2.5.1/bzrlib/tests/test_gpg.py
+===================================================================
+--- bzr-2.5.1.orig/bzrlib/tests/test_gpg.py
++++ bzr-2.5.1/bzrlib/tests/test_gpg.py
+@@ -51,7 +51,7 @@ class TestCommandLine(tests.TestCase):
+         self.my_gpg = gpg.GPGStrategy(FakeConfig())
+ 
+     def test_signing_command_line(self):
+-        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com', '--no-tty'],
++        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com'],
+                          self.my_gpg._command_line())
+ 
+     def test_signing_command_line_from_default(self):
+@@ -60,7 +60,7 @@ class TestCommandLine(tests.TestCase):
+ email=Amy <amy at example.com>
+ gpg_signing_key=default
+ gpg_signing_command=false'''))
+-        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com', '--no-tty'],
++        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com'],
+                          my_gpg._command_line())
+ 
+     def test_signing_command_line_from_email(self):
+@@ -68,7 +68,7 @@ gpg_signing_command=false'''))
+         my_gpg = gpg.GPGStrategy(FakeConfig('''
+ email=Amy <amy at example.com>
+ gpg_signing_command=false'''))
+-        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com', '--no-tty'],
++        self.assertEqual(['false',  '--clearsign', '-u', 'amy at example.com'],
+                          my_gpg._command_line())
+ 
+     def test_checks_return_code(self):
diff --git a/bzr.spec b/bzr.spec
index 69108fd..92801bb 100644
--- a/bzr.spec
+++ b/bzr.spec
@@ -28,6 +28,9 @@ Source1:        https://launchpad.net/%{name}/%{bzrmajor}/%{version}%{?bzrrc}/+d
 Source2:        bzr-icon-64.png
 # Fixed upstream here: https://bugs.launchpad.net/bzr/+bug/1182124
 Patch0:         bzr-cve2013-2099.patch
+# Fix for gpg signing when no gpg agent is present:
+# https://bugs.launchpad.net/ubuntu/+source/bzr/+bug/1014570
+Patch1: bzr-gpg-no-agent-error.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  python2-devel zlib-devel
@@ -65,6 +68,7 @@ This package contains the documentation for the Bazaar version control system.
 %prep
 %setup -q -n %{name}-%{version}%{?bzrrc}
 %patch0 -p1
+%patch1 -p1
 
 
 sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/_patiencediff_py.py
@@ -147,6 +151,10 @@ rm -rf $RPM_BUILD_ROOT
 %doc %{_defaultdocdir}/%{name}-doc-%{version}/*
 
 %changelog
+* Tue May 28 2013 Toshio Kuratomi <toshio at fedoraproject.org> - 2.5.1-12
+- Patch for failure to gpg sign commits with no gpg-agent 
+  https://bugzilla.redhat.com/show_bug.cgi?id=905087
+
 * Tue May 28 2013 Toshio Kuratomi <toshio at fedoraproject.org> - 2.5.1-11
 - BuildRequires Cython so that the C extensions are built from their original sources.
 


More information about the scm-commits mailing list