From 3b8250b8bf4f1907af0412a0452aae9f0596cfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Tue, 12 Jan 2010 10:32:55 +0000 Subject: [PATCH] Implement get.ARCH() * pisi/actionsapi/get.py: Add ARCH() for getting host architecture. Thanks to 64-bit team for pointing out this requirement. --- ChangeLog | 4 ++++ pisi/actionsapi/get.py | 4 ++++ pisi/actionsapi/variables.py | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 68be0477..e4249465 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-12 Ozan Çağlayan + * pisi/actionsapi/get.py: Add ARCH() for getting host architecture. + Thanks to 64-bit team for pointing out this requirement. + 2010-01-04 Ozan Çağlayan * pisi/actionsapi/shelltools.py (unlink): Support glob patterns in unlink(). diff --git a/pisi/actionsapi/get.py b/pisi/actionsapi/get.py index aab8ddc5..7ce0b797 100644 --- a/pisi/actionsapi/get.py +++ b/pisi/actionsapi/get.py @@ -33,6 +33,7 @@ class BinutilsError(pisi.actionsapi.Error): # Globals env = pisi.actionsapi.variables.glb.env dirs = pisi.actionsapi.variables.glb.dirs +generals = pisi.actionsapi.variables.glb.generals def curDIR(): '''returns current work directory's path''' @@ -91,6 +92,9 @@ def srcDIR(): # Build Related Functions +def ARCH(): + return generals.architecture + def HOST(): return env.host diff --git a/pisi/actionsapi/variables.py b/pisi/actionsapi/variables.py index 7e7d0a52..4e4eb00f 100644 --- a/pisi/actionsapi/variables.py +++ b/pisi/actionsapi/variables.py @@ -89,6 +89,13 @@ class Dirs: self.kde = self.values.dirs.kde_dir self.qt = self.values.dirs.qt_dir +class Generals: + '''General informations from /etc/pisi/pisi.conf''' + + def __init__(self): + self.values = ctx.config.values + self.architecture = self.values.general.architecture + # As we import this module from build.py, we can't init glb as a # singleton here. Or else Python will bug us with NoneType errors @@ -103,4 +110,5 @@ def initVariables(): global glb ctx.env = Env() ctx.dirs = Dirs() + ctx.generals = Generals() glb = ctx