remove last maven: quirks and make it always a string

It turns out that the maven: field was originally declared as a TYPE_STRING,
given that it was not given a different type in metadata.py's 	flagtypes.
The code was confused because it was given a default value of `False` rather
than `None` as the rest of the TYPE_STRING fields have.

This construct in build.py means maven: should always be a string:

        if '@' in build.maven:
            maven_dir = os.path.join(root_dir, build.maven.split('@', 1)[1])
        else:
            maven_dir = root_dir
This commit is contained in:
Hans-Christoph Steiner 2023-04-20 10:09:11 +02:00
parent a107e810d4
commit ad960c6ecd
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
7 changed files with 120 additions and 114 deletions

View file

@ -265,7 +265,7 @@ class Build(dict):
self.init = ''
self.patch = []
self.gradle = []
self.maven = False
self.maven = None
self.output = None
self.binary = None
self.srclibs = []
@ -641,10 +641,7 @@ def post_metadata_parse(app):
elif flagtype(k) is TYPE_INT:
build[k] = v
elif flagtype(k) is TYPE_STRING:
if k == 'maven':
build[k] = v
else:
build[k] = str(v)
build[k] = str(v)
builds.append(build)
app['Builds'] = sorted_builds(builds)
@ -898,9 +895,6 @@ def write_yaml(mf, app):
value = getattr(build, field)
if field == 'gradle' and value == ['off']:
value = [ruamel.yaml.scalarstring.SingleQuotedScalarString('off')]
if field in ('maven'):
if value == 'no':
continue
typ = flagtype(field)
# don't check value == True for TYPE_INT as it could be 0
if value is not None and (typ == TYPE_INT or value):