From: "Luis R. Rodriguez" <[email protected]>

The python gpg lib doesn't provide this, so just add our
own little helper.

Signed-off-by: Luis R. Rodriguez <[email protected]>
---
 lib/bpgpg.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 lib/bpgpg.py

diff --git a/lib/bpgpg.py b/lib/bpgpg.py
new file mode 100644
index 0000000..1afd58c
--- /dev/null
+++ b/lib/bpgpg.py
@@ -0,0 +1,12 @@
+import subprocess, os
+
+def sign(tar=None):
+    cmd = ['gpg', '--armor', '--detach-sign', tar]
+    process = subprocess.Popen(cmd,
+                               stdout=subprocess.PIPE, 
stderr=subprocess.STDOUT,
+                               close_fds=True, universal_newlines=True)
+    stdout = process.communicate()[0]
+    process.wait()
+    if process.returncode != 0:
+        raise ExecutionError(process.returncode)
+    return stdout
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to