aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-04-04 19:02:42 +0200
committerGuido Günther <agx@sigxcpu.org>2009-04-04 19:02:42 +0200
commit8d2c6bd851ece9c316696aa3f0760d4636626958 (patch)
tree43e12959d8112f02da6dbe7f6cb05e47cebce67f
parentabe7de464b46fae48c8d677f5438317448fc1c29 (diff)
add get_arch
returns dpkg's notion of the architecture
-rw-r--r--gbp/deb_utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gbp/deb_utils.py b/gbp/deb_utils.py
index b586aab..2879459 100644
--- a/gbp/deb_utils.py
+++ b/gbp/deb_utils.py
@@ -8,6 +8,7 @@ import email
import os
import re
import shutil
+import subprocess
import sys
import glob
import command_wrappers as gbpc
@@ -209,6 +210,12 @@ def tar_toplevel(dir):
return dir
+def get_arch():
+ pipe = subprocess.Popen(["dpkg", "--print-architecture"], shell=False, stdout=subprocess.PIPE)
+ arch = pipe.stdout.readline().strip()
+ return arch
+
+
def _test():
import doctest
doctest.testmod()