diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-04-04 19:02:42 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-04-04 19:02:42 +0200 |
commit | 8d2c6bd851ece9c316696aa3f0760d4636626958 (patch) | |
tree | 43e12959d8112f02da6dbe7f6cb05e47cebce67f /gbp | |
parent | abe7de464b46fae48c8d677f5438317448fc1c29 (diff) |
add get_arch
returns dpkg's notion of the architecture
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/deb_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gbp/deb_utils.py b/gbp/deb_utils.py index b586aabb..28794596 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() |