Commit 9fcb97b9 authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

[feat] Conditional sections: expose new 'multiarch' value in sys

To be dropped once all buildout in the wild are able to upgrade to a
version that supports new names in expression of conditional sections
(see previous commit).
parent be1cf58f
...@@ -2017,6 +2017,7 @@ class _default_globals(dict): ...@@ -2017,6 +2017,7 @@ class _default_globals(dict):
context = self.context context = self.context
except AttributeError: except AttributeError:
context = self.context = cls._default_globals() context = self.context = cls._default_globals()
context['sys'] = _sysproxy(self)
try: try:
return context[key] return context[key]
except KeyError as e: except KeyError as e:
...@@ -2036,6 +2037,18 @@ class _default_globals(dict): ...@@ -2036,6 +2037,18 @@ class _default_globals(dict):
del self['__doing__'] del self['__doing__']
return m return m
class _sysproxy(object): # BBB: alternate/temporary way to get multiarch value
def __init__(self, default_globals):
self.__default_globals = default_globals
def __getattr__(self, name):
if name == '_multiarch':
default_globals = self.__default_globals
setattr(sys, name, getattr(default_globals, name[1:])())
default_globals.context['sys'] = sys
return getattr(sys, name)
variable_template_split = re.compile('([$]{[^}]*})').split variable_template_split = re.compile('([$]{[^}]*})').split
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment