0001-zypp-PublicKey.cc-Use-GPG_BINARY-from-KeyRing.cc.patch 1.89 KB
Newer Older
1 2 3 4 5 6 7 8
From 50ed977e1b166ba23a029f3a5194121ea4d45dd7 Mon Sep 17 00:00:00 2001
From: Thomas Perl <m@thp.io>
Date: Fri, 6 Feb 2015 16:28:43 +0100
Subject: [PATCH] zypp/PublicKey.cc: Use GPG_BINARY from KeyRing.cc

On systems where "gpg" is not available, checking the public key
would fail. Use GPG_BINARY in both PublicKey.cc and KeyRing.cc,
and define it in a single place only (ExternalProgram.h).
9 10 11 12 13

The original patch was partially integrated in upstream 
commit 092cded378742fcbb0761cc470da863cb32ed537, but only as a duplicated
define in KeyRing and PublicKey. This patch now just moves the define to 
ExternalProgram.h
14 15
---
 zypp/ExternalProgram.h | 2 ++
16 17 18
 zypp/KeyRing.cc        | 3 ---
 zypp/PublicKey.cc      | 3 ---
 3 files changed, 2 insertions(+), 6 deletions(-)
19 20

diff --git a/zypp/ExternalProgram.h b/zypp/ExternalProgram.h
21
index f3fc850..99a3143 100644
22 23 24 25 26 27 28 29 30 31 32 33
--- a/zypp/ExternalProgram.h
+++ b/zypp/ExternalProgram.h
@@ -22,6 +22,8 @@
 #include "zypp/base/ExternalDataSource.h"
 #include "zypp/Pathname.h"
 
+#define GPG_BINARY "/usr/bin/gpg2"
+
 namespace zypp {
 
     /**
diff --git a/zypp/KeyRing.cc b/zypp/KeyRing.cc
34
index d6b8246..826ce4c 100644
35 36
--- a/zypp/KeyRing.cc
+++ b/zypp/KeyRing.cc
37
@@ -35,9 +35,6 @@ using std::endl;
38 39 40
 #undef  ZYPP_BASE_LOGGER_LOGGROUP
 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::KeyRing"
 
41
-/** \todo Fix duplicate define in PublicKey/KeyRing */
42 43 44 45 46 47
-#define GPG_BINARY "/usr/bin/gpg2"
-
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
diff --git a/zypp/PublicKey.cc b/zypp/PublicKey.cc
48
index fa17b79..fdbc95e 100644
49 50
--- a/zypp/PublicKey.cc
+++ b/zypp/PublicKey.cc
51 52 53 54 55 56 57 58 59 60
@@ -28,9 +28,6 @@
 
 #include <ctime>
 
-/** \todo Fix duplicate define in PublicKey/KeyRing */
-#define GPG_BINARY "/usr/bin/gpg2"
-
 using std::endl;
 
 ///////////////////////////////////////////////////////////////////
61
-- 
62 63
1.8.3-rc3

64