summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2022-10-10 11:30:35 +1100
committerChris Johns <chrisj@rtems.org>2022-10-10 11:30:35 +1100
commitd7baa5a5c693a5a86db75bb1493dd219b877f3a7 (patch)
tree9f229b205c855f1d1a30b67533b28a7d3b29b496
parent08061a9fda02ea091dcd9866e9d40ea794ae65b4 (diff)
pkg/linux: Add RPM config values
-rw-r--r--pkg/linux.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/linux.py b/pkg/linux.py
index 7be7cb7..3887520 100644
--- a/pkg/linux.py
+++ b/pkg/linux.py
@@ -76,6 +76,12 @@ def rpm_config_parser(bld, build):
except pkg.configs.get_config_error() as ce:
bld.fatal('rpm config parse error: ' + str(ce))
user_config = []
+ if bld.env.RPM_CONFIG_VALUES:
+ for cv in bld.env.RPM_CONFIG_VALUES:
+ ci = cv.split('=', 1)
+ if len(ci) != 2:
+ bld.fatal('invalid RPM config value: ' + cv)
+ user_config += ['%%define %s %s' % (ci[0], ci[1])]
for ci in items:
user_config += ['%%define %s %s' % (ci[0], ci[1])]
return os.linesep.join(user_config)
@@ -96,6 +102,12 @@ def rpm_configure(conf):
conf.msg('RPM config', conf.options.rpm_config)
conf.env.RPM_CONFIG = conf.options.rpm_config
rpm_get_config(conf)
+ if conf.options.rpm_config_value:
+ conf.env.RPM_CONFIG_VALUES = conf.options.rpm_config_value
+ conf.msg('RPM config values', len(conf.options.rpm_config_value))
+ else:
+ if conf.options.rpm_config_value:
+ conf.fatal('RPM configuration value and no INI file')
def rpm_build(bld, build):
@@ -141,6 +153,12 @@ def options(opt):
default=None,
dest='rpm_config',
help='RPM configuration INI file')
+ opt.add_option('--rpm-config-value',
+ action='append',
+ type=str,
+ default=None,
+ dest='rpm_config_value',
+ help='Set RPM configuration value (key=value)')
def configure(conf):