[PATCH] Make path to gpg binary a configurable parameter.

Serafeim Zanikolas serzan at hellug.gr
Tue Feb 3 00:05:52 CET 2009


---
 debexpo/lib/utils.py |   13 +++++++++++--
 development.ini      |    3 +++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/debexpo/lib/utils.py b/debexpo/lib/utils.py
index 92fe878..6bec930 100644
--- a/debexpo/lib/utils.py
+++ b/debexpo/lib/utils.py
@@ -36,8 +36,13 @@ __copyright__ = 'Copyright © 2008 Jonny Lamb'
 __license__ = 'MIT'
 
 import commands
-import os
+import logging
 import md5
+import os
+
+from pylons import config
+
+log = logging.getLogger(__name__)
 
 def allowed_upload(filename):
     """
@@ -114,7 +119,11 @@ def parse_key_id(key):
     ``key``
         ASCII armored GPG public key.
     """
-    cmd = 'echo "%s" | gpg2' % key
+    gpg_path = config['debexpo.gpg_path']
+    if not gpg_path:
+        log.error('debexpo.gpg_path is not set in configuration file.')
+        return None
+    cmd = 'echo "%s" | %s' % (key, gpg_path)
     status, output = commands.getstatusoutput(cmd)
     if status != 0:
         return None
diff --git a/development.ini b/development.ini
index 041ad54..7e722e8 100644
--- a/development.ini
+++ b/development.ini
@@ -87,6 +87,9 @@ debexpo.changes_list = jonny at server
 # Server debexpo is being run on including http:// and excluding trailing slash
 debexpo.server = http://localhost:5000
 
+# Path to the gpg binary
+debexpo.gpg_path = /usr/bin/gpg
+
 # DEBEXPO
 # The folling configuration settings allow you to customize the looks
 # of your web site. You can either comment it out or specify a path
-- 
1.5.6.5


--+QahgC5+KEYLbs62--


More information about the debexpo-devel mailing list