Commit 2308e07b authored by André Anjos's avatar André Anjos 💬

[ci] Move read_packages() from scripts.ci to ci

parent b2b82ff4
...@@ -72,3 +72,24 @@ def is_stable(package, refname, tag, repodir): ...@@ -72,3 +72,24 @@ def is_stable(package, refname, tag, repodir):
logger.info('No tag information available at build') logger.info('No tag information available at build')
logger.info('Considering this to be a pre-release build') logger.info('Considering this to be a pre-release build')
return False return False
def read_packages(filename):
"""
Return a python list of tuples (repository, branch), given a file containing
one package (and branch) per line. Comments are excluded
"""
# loads dirnames from order file (accepts # comments and empty lines)
packages = []
with open(filename, 'rt') as f:
for line in f:
line = line.partition('#')[0].strip()
if line:
if ',' in line: #user specified a branch
path, branch = [k.strip() for k in line.split(',', 1)]
packages.append((path, branch))
else:
packages.append((line, 'master'))
return packages
Markdown is supported
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