Commit cca56f23 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

lb-dev: add support for undefined or "best" platform

parent 58b4e8e6
......@@ -102,8 +102,6 @@ def main():
args.platform = checkPlatform(parser, args.platform)
if args.version:
'deprecated version specification: '
......@@ -117,12 +115,28 @@ def main():
project, version = args.project
version = expandVersionAlias(project, version, args.platform)
except ValueError:
parser.error('wrong number of arguments')
project = fixProjectCase(project)
args.platform = checkPlatform(parser, args.platform) or "best"
version = expandVersionAlias(
project, version, args.platform if args.platform != "best" else "any")
if args.platform == "best":
from LbEnv.ProjectEnv.lookup import listPlatforms
from LbEnv.ProjectEnv.script import HOST_INFO
from LbPlatformUtils import host_supports_tag
args.platform = next(
p for p in listPlatforms(project, version)
if host_supports_tag(HOST_INFO, p))
except StopIteration:
sys.stderr.write("none of the available platforms is supported:"
" {!r}\n".format(listPlatforms(project, version)))
from LbEnv.ProjectEnv.lookup import InvalidNightlySlotError
from LbEnv.ProjectEnv.script import localNightlyHelp
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment