@@ -541,6 +541,8 @@ class Source(models.Model):
return self.url
elif self.url.startswith('git://github.com'):
return drop_dotgit('https' + self.url[3:])
+ elif self.url.startswith('git://git.openembedded.org'):
+ return drop_dotgit('https://git.openembedded.org' + self.url[26:])
elif self.url.startswith('git://git.yoctoproject.org'):
return drop_dotgit('https://git.yoctoproject.org' + self.url[26:])
elif self.url.startswith('git://git.kernel.org'):
@@ -34,10 +34,10 @@ def set_vcs_fields(layer, repoval):
layer.vcs_url = repoval
if repoval.startswith('git://git.openembedded.org/'):
reponame = re.sub('^.*/', '', repoval)
- layer.vcs_web_url = 'http://cgit.openembedded.org/' + reponame
- layer.vcs_web_tree_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_file_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
+ layer.vcs_web_url = 'https://git.openembedded.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_file_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_commit_url = 'https://git.openembedded.org/' + reponame + '/commit/?id=%hash%'
elif repoval.startswith('git://git.yoctoproject.org/'):
reponame = re.sub('^.*/', '', repoval)
layer.vcs_web_url = 'https://git.yoctoproject.org/' + reponame
@@ -47,24 +47,24 @@ def set_vcs_fields(layer, repoval):
elif repoval.startswith('git://github.com/') or repoval.startswith('http://github.com/') or repoval.startswith('https://github.com/'):
reponame = re.sub('^.*github.com/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://github.com/' + reponame
- layer.vcs_web_tree_base_url = 'http://github.com/' + reponame + '/tree/%branch%/'
- layer.vcs_web_file_base_url = 'http://github.com/' + reponame + '/blob/%branch%/'
- layer.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%'
+ layer.vcs_web_url = 'https://github.com/' + reponame
+ layer.vcs_web_tree_base_url = 'https://github.com/' + reponame + '/tree/%branch%/'
+ layer.vcs_web_file_base_url = 'https://github.com/' + reponame + '/blob/%branch%/'
+ layer.vcs_web_commit_url = 'https://github.com/' + reponame + '/commit/%hash%'
elif repoval.startswith('git://gitlab.com/') or repoval.startswith('http://gitlab.com/') or repoval.startswith('https://gitlab.com/'):
reponame = re.sub('^.*gitlab.com/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://gitlab.com/' + reponame
- layer.vcs_web_tree_base_url = 'http://gitlab.com/' + reponame + '/tree/%branch%/'
- layer.vcs_web_file_base_url = 'http://gitlab.com/' + reponame + '/blob/%branch%/'
- layer.vcs_web_commit_url = 'http://gitlab.com/' + reponame + '/commit/%hash%'
+ layer.vcs_web_url = 'https://gitlab.com/' + reponame
+ layer.vcs_web_tree_base_url = 'https://gitlab.com/' + reponame + '/tree/%branch%/'
+ layer.vcs_web_file_base_url = 'https://gitlab.com/' + reponame + '/blob/%branch%/'
+ layer.vcs_web_commit_url = 'https://gitlab.com/' + reponame + '/commit/%hash%'
elif repoval.startswith('git://bitbucket.org/') or repoval.startswith('http://bitbucket.org/') or repoval.startswith('https://bitbucket.org/'):
reponame = re.sub('^.*bitbucket.org/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://bitbucket.org/' + reponame
- layer.vcs_web_tree_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- layer.vcs_web_file_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- layer.vcs_web_commit_url = 'http://bitbucket.org/' + reponame + '/commits/%hash%'
+ layer.vcs_web_url = 'https://bitbucket.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ layer.vcs_web_file_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ layer.vcs_web_commit_url = 'https://bitbucket.org/' + reponame + '/commits/%hash%'
def readme_extract(readmefn):
@@ -98,10 +98,10 @@ def main():
layer.vcs_url = repoval
if repoval.startswith('git://git.openembedded.org/'):
reponame = re.sub('^.*/', '', repoval)
- layer.vcs_web_url = 'http://cgit.openembedded.org/' + reponame
- layer.vcs_web_tree_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_file_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
+ layer.vcs_web_url = 'https://git.openembedded.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_file_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_commit_url = 'https://git.openembedded.org/' + reponame + '/commit/?id=%hash%'
elif repoval.startswith('git://git.yoctoproject.org/'):
reponame = re.sub('^.*/', '', repoval)
layer.vcs_web_url = 'https://git.yoctoproject.org/' + reponame
@@ -111,24 +111,24 @@ def main():
elif repoval.startswith('git://github.com/') or repoval.startswith('http://github.com/') or repoval.startswith('https://github.com/'):
reponame = re.sub('^.*github.com/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://github.com/' + reponame
- layer.vcs_web_tree_base_url = 'http://github.com/' + reponame + '/tree/%branch%/'
- layer.vcs_web_file_base_url = 'http://github.com/' + reponame + '/blob/%branch%/'
- layer.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%'
+ layer.vcs_web_url = 'https://github.com/' + reponame
+ layer.vcs_web_tree_base_url = 'https://github.com/' + reponame + '/tree/%branch%/'
+ layer.vcs_web_file_base_url = 'https://github.com/' + reponame + '/blob/%branch%/'
+ layer.vcs_web_commit_url = 'https://github.com/' + reponame + '/commit/%hash%'
elif repoval.startswith('git://gitlab.com/') or repoval.startswith('http://gitlab.com/') or repoval.startswith('https://gitlab.com/'):
reponame = re.sub('^.*gitlab.com/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://gitlab.com/' + reponame
- layer.vcs_web_tree_base_url = 'http://gitlab.com/' + reponame + '/tree/%branch%/'
- layer.vcs_web_file_base_url = 'http://gitlab.com/' + reponame + '/blob/%branch%/'
- layer.vcs_web_commit_url = 'http://gitlab.com/' + reponame + '/commit/%hash%'
+ layer.vcs_web_url = 'https://gitlab.com/' + reponame
+ layer.vcs_web_tree_base_url = 'https://gitlab.com/' + reponame + '/tree/%branch%/'
+ layer.vcs_web_file_base_url = 'https://gitlab.com/' + reponame + '/blob/%branch%/'
+ layer.vcs_web_commit_url = 'https://gitlab.com/' + reponame + '/commit/%hash%'
elif repoval.startswith('git://bitbucket.org/') or repoval.startswith('http://bitbucket.org/') or repoval.startswith('https://bitbucket.org/'):
reponame = re.sub('^.*bitbucket.org/', '', repoval)
reponame = re.sub('.git$', '', reponame)
- layer.vcs_web_url = 'http://bitbucket.org/' + reponame
- layer.vcs_web_tree_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- layer.vcs_web_file_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- layer.vcs_web_commit_url = 'http://bitbucket.org/' + reponame + '/commits/%hash%'
+ layer.vcs_web_url = 'https://bitbucket.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ layer.vcs_web_file_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ layer.vcs_web_commit_url = 'https://bitbucket.org/' + reponame + '/commits/%hash%'
elif '.git' in repoval:
res = link_re.match(fields[5].strip())
layer.vcs_web_url = res.groups(1)[0]
@@ -198,10 +198,10 @@
if( repoval.startsWith('git://git.openembedded.org/') ) {
reponame = repoval.replace(/^.*\//, '')
- this.vcs_web_url = 'http://cgit.openembedded.org/' + reponame
- this.vcs_web_tree_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- this.vcs_web_file_base_url = 'http://cgit.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
- this.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
+ this.vcs_web_url = 'https://git.openembedded.org/' + reponame
+ this.vcs_web_tree_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_file_base_url = 'https://git.openembedded.org/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_commit_url = 'https://git.openembedded.org/' + reponame + '/commit/?id=%hash%'
this.vcs_web_type = 'cgit'
}
else if( repoval.startsWith('git://git.yoctoproject.org/') ) {
@@ -215,28 +215,28 @@
else if( repoval.startsWith('git://github.com/') ) {
reponame = repoval.replace(/^.*github.com\//, '')
reponame = reponame.replace(/.git$/, '')
- this.vcs_web_url = 'http://github.com/' + reponame
- this.vcs_web_tree_base_url = 'http://github.com/' + reponame + '/tree/%branch%/'
- this.vcs_web_file_base_url = 'http://github.com/' + reponame + '/blob/%branch%/'
- this.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%/'
+ this.vcs_web_url = 'https://github.com/' + reponame
+ this.vcs_web_tree_base_url = 'https://github.com/' + reponame + '/tree/%branch%/'
+ this.vcs_web_file_base_url = 'https://github.com/' + reponame + '/blob/%branch%/'
+ this.vcs_web_commit_url = 'https://github.com/' + reponame + '/commit/%hash%/'
this.vcs_web_type = '(custom)'
}
else if( repoval.startsWith('git://gitlab.com/') ) {
reponame = repoval.replace(/^.*gitlab.com\//, '')
reponame = reponame.replace(/.git$/, '')
- this.vcs_web_url = 'http://gitlab.com/' + reponame
- this.vcs_web_tree_base_url = 'http://gitlab.com/' + reponame + '/tree/%branch%/'
- this.vcs_web_file_base_url = 'http://gitlab.com/' + reponame + '/blob/%branch%/'
- this.vcs_web_commit_url = 'http://gitlab.com/' + reponame + '/commit/%hash%/'
+ this.vcs_web_url = 'https://gitlab.com/' + reponame
+ this.vcs_web_tree_base_url = 'https://gitlab.com/' + reponame + '/tree/%branch%/'
+ this.vcs_web_file_base_url = 'https://gitlab.com/' + reponame + '/blob/%branch%/'
+ this.vcs_web_commit_url = 'https://gitlab.com/' + reponame + '/commit/%hash%/'
this.vcs_web_type = '(custom)'
}
else if( repoval.startsWith('git://bitbucket.org/') ) {
reponame = repoval.replace(/^.*bitbucket.org\//, '')
reponame = reponame.replace(/.git$/, '')
- this.vcs_web_url = 'http://bitbucket.org/' + reponame
- this.vcs_web_tree_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- this.vcs_web_file_base_url = 'http://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
- this.vcs_web_commit_url = 'http://bitbucket.org/' + reponame + '/commits/%hash%'
+ this.vcs_web_url = 'https://bitbucket.org/' + reponame
+ this.vcs_web_tree_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ this.vcs_web_file_base_url = 'https://bitbucket.org/' + reponame + '/src/%branch%/%path%?at=%branch%'
+ this.vcs_web_commit_url = 'https://bitbucket.org/' + reponame + '/commits/%hash%'
this.vcs_web_type = '(custom)'
}
else {
The old cgit.openembedded.org URLs redirect to git.openembedded. Update all references to use the new URLs and switch from http to https. While we are here, use https for github, gitlab and bitbucket, as http:// URLs redirect for all of these providers as well. Fixes [Yocto #16272] Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- layerindex/models.py | 2 ++ layerindex/tools/import_layer.py | 32 +++++++++++++------------- layerindex/tools/import_wiki_layers.py | 32 +++++++++++++------------- templates/layerindex/editlayer.html | 32 +++++++++++++------------- 4 files changed, 50 insertions(+), 48 deletions(-)