From fa03ed3bce89e16c86b28b8419e1b540f8d1d627 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 3 Jul 2023 02:36:40 +0300 Subject: [PATCH] wscript: fix mod_options.txt parsing under Python2 --- wscript | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/wscript b/wscript index 71f485f0..02efd884 100644 --- a/wscript +++ b/wscript @@ -214,18 +214,19 @@ def configure(conf): with open('mod_options.txt') as fd: lines = fd.readlines() for line in lines: - p = regex.match(line.strip()) - if p: - conf.start_msg("* " + p[3]) - if p[2] == 'ON': - conf.env[p[1]] = True - conf.define(p[1], 1) - elif p[2] == 'OFF': - conf.env[p[1]] = False - conf.undefine(p[1]) + m = regex.match(line.strip()) + if m: + p = m.groups() + conf.start_msg("* " + p[2]) + if p[1] == 'ON': + conf.env[p[0]] = True + conf.define(p[0], 1) + elif p[1] == 'OFF': + conf.env[p[0]] = False + conf.undefine(p[0]) else: - conf.env[p[1]] = p[2] - conf.end_msg(p[2]) + conf.env[p[0]] = p[1] + conf.end_msg(p[1]) if conf.env.HLDEMO_BUILD and conf.env.OEM_BUILD: conf.fatal('Don\'t mix Demo and OEM builds!')