mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
convert-srcuri.py: use regex to check space in SRC_URI
There may be none, one or more spaces including tab before backslash in SRC_URI. Use regex to check and update. It helps to avoid malformed uri such as recipe open-iscsi-user in meta-openstack: SRC_URI = "git://github.com/open-iscsi/open-iscsi.git;protocol=https ;branch=master \ And help to check more recipes such as concurrent-ruby in the same layer: SRC_URI = "git://github.com/ruby-concurrency/concurrent-ruby.git;protocol=https;tag=v1.1.6\ (From OE-Core rev: 0a25dbe3912bff88e5c8cbc50302cae3c261dfbc) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a69a53573b1987ee5834a6fc27763f9bbf5fe5a4) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d5ced40b3e
commit
35bc79ce7c
|
|
@ -35,16 +35,16 @@ def processfile(fn):
|
|||
if ("git://" in line or "gitsm://" in line) and "branch=" not in line and matchline(line):
|
||||
if line.endswith('"\n'):
|
||||
line = line.replace('"\n', ';branch=master"\n')
|
||||
elif line.endswith(" \\\n"):
|
||||
line = line.replace(' \\\n', ';branch=master \\\n')
|
||||
elif re.search('\s*\\\\$', line):
|
||||
line = re.sub('\s*\\\\$', ';branch=master \\\\', line)
|
||||
modified = True
|
||||
if ("git://" in line or "gitsm://" in line) and "github.com" in line and "protocol=https" not in line and matchline(line):
|
||||
if "protocol=git" in line:
|
||||
line = line.replace('protocol=git', 'protocol=https')
|
||||
elif line.endswith('"\n'):
|
||||
line = line.replace('"\n', ';protocol=https"\n')
|
||||
elif line.endswith(" \\\n"):
|
||||
line = line.replace(' \\\n', ';protocol=https \\\n')
|
||||
elif re.search('\s*\\\\$', line):
|
||||
line = re.sub('\s*\\\\$', ';protocol=https \\\\', line)
|
||||
modified = True
|
||||
new_file.write(line)
|
||||
if modified:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user