Skip to content

allow tag to be used in mbed import #873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,6 @@ def fromurl(cls, url, path=None):
repo.path = os.path.abspath(path or os.path.join(getcwd(), repo.name))
repo.url = formaturl(m_repo_ref.group(1))
repo.rev = m_repo_ref.group(3)
if repo.rev and repo.rev != 'latest' and repo.rev != 'tip' and not re.match(r'^([a-fA-F0-9]{6,40})$', repo.rev):
error('Invalid revision (%s)' % repo.rev, -1)
else:
error('Invalid repository (%s)' % url.strip(), -1)

Expand All @@ -1060,6 +1058,12 @@ def fromlib(cls, lib=None):
m_local = re.match(regex_local_ref, ref.strip().replace('\\', '/'))
m_repo_ref = re.match(regex_url_ref, ref.strip().replace('\\', '/'))
m_bld_ref = re.match(regex_build_url, ref.strip().replace('\\', '/'))

if m_repo_ref:
rev = m_repo_ref.group(3)
if rev and not re.match(r'^([a-fA-F0-9]{6,40})$', rev):
error('Named branches not allowed in .lib, offending lib is {} '.format(os.path.basename(lib)))

if not (m_local or m_bld_ref or m_repo_ref):
warning(
"File \"%s\" in \"%s\" uses a non-standard .lib file extension, which is not compatible with the mbed build tools.\n" % (os.path.basename(lib), os.path.split(lib)[0]))
Expand Down