Flags class is useless as it doesn't have any state or data to carry
with. For exporting variables a function is sufficient.
This commit is contained in:
@@ -20,9 +20,24 @@ import pisi.constants
|
|||||||
|
|
||||||
# Set individual information, that are generally needed for ActionsAPI
|
# Set individual information, that are generally needed for ActionsAPI
|
||||||
|
|
||||||
|
def exportFlags():
|
||||||
|
'''General flags used in actions API.'''
|
||||||
|
|
||||||
|
# Build systems depend on these environment variables. That is why
|
||||||
|
# we export them instead of using as (instance) variables.
|
||||||
|
values = pisi.config.config.values
|
||||||
|
environ['HOST'] = host = values.build.host
|
||||||
|
environ['CFLAGS'] = cflags = values.build.cflags
|
||||||
|
environ['CXXFLAGS'] = cxxflags = values.build.cxxflags
|
||||||
|
environ['LDFLAGS'] = ldflags = values.build.ldflags
|
||||||
|
|
||||||
|
|
||||||
class Env(object):
|
class Env(object):
|
||||||
'''General environment variables used in actions API'''
|
'''General environment variables used in actions API'''
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
|
setFlags()
|
||||||
|
|
||||||
self.__vars = {
|
self.__vars = {
|
||||||
'pkg_dir': 'PKG_DIR',
|
'pkg_dir': 'PKG_DIR',
|
||||||
'work_dir': 'WORK_DIR',
|
'work_dir': 'WORK_DIR',
|
||||||
@@ -58,18 +73,10 @@ class Dirs:
|
|||||||
localstate = 'var/lib'
|
localstate = 'var/lib'
|
||||||
defaultprefix = 'usr'
|
defaultprefix = 'usr'
|
||||||
|
|
||||||
class Flags:
|
|
||||||
'''General flags used in actions API'''
|
|
||||||
values = pisi.config.config.values
|
|
||||||
environ['HOST'] = host = values.build.host
|
|
||||||
environ['CFLAGS'] = cflags = values.build.cflags
|
|
||||||
environ['CXXFLAGS'] = cxxflags = values.build.cxxflags
|
|
||||||
environ['LDFLAGS'] = ldflags = values.build.ldflags
|
|
||||||
|
|
||||||
class Variables(pisi.config.Config):
|
class Variables(pisi.config.Config):
|
||||||
const = pisi.constants.const
|
const = pisi.constants.const
|
||||||
env = Env()
|
env = Env()
|
||||||
dirs = Dirs()
|
dirs = Dirs()
|
||||||
flags = Flags()
|
|
||||||
|
|
||||||
glb = Variables()
|
glb = Variables()
|
||||||
|
|||||||
Reference in New Issue
Block a user