From: Michael Tremer Date: Mon, 5 Apr 2010 13:04:36 +0000 (+0200) Subject: naoki: Set debugging mode correctly to config class. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a2d1c464b93017367af60819576522a7dfd3d1a;p=ipfire-3.x.git naoki: Set debugging mode correctly to config class. --- diff --git a/naoki/constants.py b/naoki/constants.py index 85cd728e4..2ad4e8c5e 100644 --- a/naoki/constants.py +++ b/naoki/constants.py @@ -53,6 +53,7 @@ class Config(object): "cleanup_on_success" : True, # # CLI variables + "debug" : False, "quiet" : False, # # Distro items @@ -93,9 +94,15 @@ class Config(object): def __setitem__(self, item, value): self._items[item] = value + def __getattr__(self, *args): + return self.__getitem__(*args) + + def __setattr__(self, *args): + return self.__setitem__(*args) + @property def environment(self): - return { + ret = { "HOME" : os.environ.get("HOME", "/root"), "TERM" : os.environ.get("TERM", ""), "PS1" : os.environ.get("PS1", "\u:\w\$ "), @@ -109,6 +116,11 @@ class Config(object): "PARALLELISMFLAGS" : "-j%d" % self["parallelism"], } + if self["debug"]: + ret["NAOKI_DEBUG"] = "1" + + return ret + class Architectures(object): def __init__(self, configfile): diff --git a/naoki/terminal.py b/naoki/terminal.py index 5337962e2..36f1dc236 100644 --- a/naoki/terminal.py +++ b/naoki/terminal.py @@ -258,6 +258,7 @@ class Commandline(object): self.naoki.logging.quiet(args.quiet) # Set debugging mode + config.debug = args.debug self.naoki.logging.debug(args.debug) # Set architecture