Skip to content
Snippets Groups Projects
Commit a5bcd155 authored by Matt Selsky's avatar Matt Selsky
Browse files

Eliminate parse_version() function

The intermediate storage is never reused
parent 00a7223f
No related branches found
No related tags found
Loading
Pipeline #
......@@ -75,18 +75,6 @@ def configure(ctx):
pprint("NORMAL", " %-30s: " % name, sep="")
pprint("YELLOW", val)
def parse_version(config):
with open("VERSION", "r") as f:
version_string = f.read().split(" ")[0].strip()
[major, minor, rev] = version_string.split(".")
# "NTPS" for NTPSec
# this avoids any naming collisions
map = {"NTPSEC_VERSION_MAJOR": int(major),
"NTPSEC_VERSION_MINOR": int(minor),
"NTPSEC_VERSION_REV": int(rev)}
config.update(map)
srcnode = ctx.srcnode.abspath()
bldnode = ctx.bldnode.abspath()
......@@ -95,11 +83,12 @@ def configure(ctx):
ctx.load('waf_unit_test')
ctx.load('gnu_dirs')
parse_version(config)
ctx.env.NTPSEC_VERSION_MAJOR = config["NTPSEC_VERSION_MAJOR"]
ctx.env.NTPSEC_VERSION_MINOR = config["NTPSEC_VERSION_MINOR"]
ctx.env.NTPSEC_VERSION_REV = config["NTPSEC_VERSION_REV"]
with open("VERSION", "r") as f:
version_string = f.read().split(" ")[0].strip()
[major, minor, rev] = version_string.split(".")
ctx.env.NTPSEC_VERSION_MAJOR = int(major)
ctx.env.NTPSEC_VERSION_MINOR = int(minor)
ctx.env.NTPSEC_VERSION_REV = int(rev)
ctx.env.NTPSEC_VERSION = "%s.%s.%s" % (ctx.env.NTPSEC_VERSION_MAJOR,
ctx.env.NTPSEC_VERSION_MINOR,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment