|
126 | 126 | mbed_sdk_tools_url = 'https://mbed.org/users/mbed_official/code/mbed-sdk-tools'
|
127 | 127 |
|
128 | 128 | # a list of public SCM service (github/butbucket) which support http, https and ssh schemas
|
129 |
| -public_repo_services = ['bitbucket.org', 'github.com', 'gitlab.com'] |
| 129 | +public_scm_services = ['bitbucket.org', 'github.com', 'gitlab.com'] |
130 | 130 |
|
131 | 131 |
|
132 | 132 | # verbose logging
|
@@ -1096,7 +1096,7 @@ def isurl(cls, url):
|
1096 | 1096 |
|
1097 | 1097 | @classmethod
|
1098 | 1098 | def isinsecure(cls, url):
|
1099 |
| - up = urlparse(url, 'https') |
| 1099 | + up = urlparse(url) |
1100 | 1100 | return not up or not up.scheme or up.scheme not in ['http', 'https', 'ssh', 'git'] or (up.port and int(up.port) not in [22, 80, 443])
|
1101 | 1101 |
|
1102 | 1102 | @property
|
@@ -1178,7 +1178,7 @@ def remove(self, dest, *args, **kwargs):
|
1178 | 1178 | pass
|
1179 | 1179 | return self.scm.remove(dest, *args, **kwargs)
|
1180 | 1180 |
|
1181 |
| - def clone(self, url, path, rev=None, depth=None, protocol=None, insecure=False, **kwargs): |
| 1181 | + def clone(self, url, path, rev=None, depth=None, protocol=None, **kwargs): |
1182 | 1182 | # Sorted so repositories that match urls are attempted first
|
1183 | 1183 | info("Trying to guess source control management tool. Supported SCMs: %s" % ', '.join([s.name for s in scms.values()]))
|
1184 | 1184 | for _, scm in scms.items():
|
@@ -1246,14 +1246,14 @@ def write(self):
|
1246 | 1246 | if os.path.isfile(self.lib):
|
1247 | 1247 | with open(self.lib) as f:
|
1248 | 1248 | lib_repo = Repo.fromurl(f.read().strip())
|
1249 |
| - if (formaturl(lib_repo.url, 'https') == formaturl(url, 'https') # match URLs in common format (https) |
1250 |
| - and (lib_repo.rev == self.rev # match revs, even if rev is None (valid for repos with no revisions) |
| 1249 | + if (formaturl(lib_repo.url, 'https') == formaturl(url, 'https') # match URLs in common schema (https) |
| 1250 | + and (lib_repo.rev == self.rev # match revs, even if rev is None (valid for repos with no revisions) |
1251 | 1251 | or (lib_repo.rev and self.rev
|
1252 | 1252 | and lib_repo.rev == self.rev[0:len(lib_repo.rev)]))): # match long and short rev formats
|
1253 | 1253 | #print self.name, 'unmodified'
|
1254 | 1254 | return
|
1255 | 1255 |
|
1256 |
| - if up.hostname in public_repo_services: |
| 1256 | + if up.hostname in public_scm_services: |
1257 | 1257 | # Safely convert repo URL to https schema if this is a public SCM service (github/butbucket), supporting all schemas.
|
1258 | 1258 | # This allows anonymous cloning of public repos without having to have ssh keys and associated accounts at github/bitbucket/etc.
|
1259 | 1259 | # Without this anonymous users will get clone errors with ssh repository links even if the repository is public.
|
|
0 commit comments