[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-780-ga363455
Andreas Beckmann
debian at abeckmann.de
Mon Jun 18 20:52:24 UTC 2012
The following commit has been merged in the develop branch:
commit acd1edc8ecf35da4c671c83b9a849d06ff5d3913
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Wed Jun 13 14:29:41 2012 +0200
lib/conf: add get_arch() method
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piupartslib/conf.py b/piupartslib/conf.py
index b0cff91..fc3e6cb 100644
--- a/piupartslib/conf.py
+++ b/piupartslib/conf.py
@@ -23,6 +23,7 @@
import ConfigParser
import UserDict
+import subprocess
class MissingMandatorySetting(Exception):
@@ -72,4 +73,12 @@ class Config(UserDict.UserDict):
return self["area"]
return "main"
+ def get_arch(self):
+ if not self["arch"]:
+ # Try to figure it out ourselves, using dpkg
+ p = subprocess.Popen(["dpkg", "--print-architecture"],
+ stdout=subprocess.PIPE)
+ self["arch"] = p.stdout.read().rstrip()
+ return self["arch"]
+
# vi:set et ts=4 sw=4 :
--
piuparts git repository
More information about the Piuparts-commits
mailing list