diff options
-rwxr-xr-x | scripts/contrib/convert-srcuri.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/contrib/convert-srcuri.py b/scripts/contrib/convert-srcuri.py index 5b362ea2e8..587392334f 100755 --- a/scripts/contrib/convert-srcuri.py +++ b/scripts/contrib/convert-srcuri.py | |||
@@ -35,16 +35,16 @@ def processfile(fn): | |||
35 | if ("git://" in line or "gitsm://" in line) and "branch=" not in line and matchline(line): | 35 | if ("git://" in line or "gitsm://" in line) and "branch=" not in line and matchline(line): |
36 | if line.endswith('"\n'): | 36 | if line.endswith('"\n'): |
37 | line = line.replace('"\n', ';branch=master"\n') | 37 | line = line.replace('"\n', ';branch=master"\n') |
38 | elif line.endswith(" \\\n"): | 38 | elif re.search('\s*\\\\$', line): |
39 | line = line.replace(' \\\n', ';branch=master \\\n') | 39 | line = re.sub('\s*\\\\$', ';branch=master \\\\', line) |
40 | modified = True | 40 | modified = True |
41 | if ("git://" in line or "gitsm://" in line) and "github.com" in line and "protocol=https" not in line and matchline(line): | 41 | if ("git://" in line or "gitsm://" in line) and "github.com" in line and "protocol=https" not in line and matchline(line): |
42 | if "protocol=git" in line: | 42 | if "protocol=git" in line: |
43 | line = line.replace('protocol=git', 'protocol=https') | 43 | line = line.replace('protocol=git', 'protocol=https') |
44 | elif line.endswith('"\n'): | 44 | elif line.endswith('"\n'): |
45 | line = line.replace('"\n', ';protocol=https"\n') | 45 | line = line.replace('"\n', ';protocol=https"\n') |
46 | elif line.endswith(" \\\n"): | 46 | elif re.search('\s*\\\\$', line): |
47 | line = line.replace(' \\\n', ';protocol=https \\\n') | 47 | line = re.sub('\s*\\\\$', ';protocol=https \\\\', line) |
48 | modified = True | 48 | modified = True |
49 | new_file.write(line) | 49 | new_file.write(line) |
50 | if modified: | 50 | if modified: |