@@ -428,7 +428,7 @@ The code for this application is maintained by the Yocto Project.
The latest version of the code can always be found here:
- http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
+ https://git.yoctoproject.org/layerindex-web/
Contributions are welcome. Please send patches / pull requests to
yocto-patches@lists.yoctoproject.org with '[layerindex-web]' in the
new file mode 100644
@@ -0,0 +1,29 @@
+# Generated by Django 5.2.12 on 2026-04-09 18:51
+
+from django.db import migrations
+
+
+def fix_yoctoproject_cgit_urls(apps, schema_editor):
+ """Update git.yoctoproject.org URLs from old cgit paths to new direct paths."""
+ LayerItem = apps.get_model('layerindex', 'LayerItem')
+
+ old = 'http://git.yoctoproject.org/cgit/cgit.cgi/'
+ new = 'https://git.yoctoproject.org/'
+
+ for layer in LayerItem.objects.filter(vcs_web_url__contains='git.yoctoproject.org/cgit/cgit.cgi/'):
+ layer.vcs_web_url = layer.vcs_web_url.replace(old, new)
+ layer.vcs_web_tree_base_url = layer.vcs_web_tree_base_url.replace(old, new)
+ layer.vcs_web_file_base_url = layer.vcs_web_file_base_url.replace(old, new)
+ layer.vcs_web_commit_url = layer.vcs_web_commit_url.replace(old, new)
+ layer.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('layerindex', '0050_alter_recipe_inherits_alter_recipe_license'),
+ ]
+
+ operations = [
+ migrations.RunPython(fix_yoctoproject_cgit_urls, migrations.RunPython.noop),
+ ]
@@ -542,7 +542,7 @@ class Source(models.Model):
elif self.url.startswith('git://github.com'):
return drop_dotgit('https' + self.url[3:])
elif self.url.startswith('git://git.yoctoproject.org'):
- return drop_dotgit('https://git.yoctoproject.org/cgit/cgit.cgi' + self.url[26:])
+ return drop_dotgit('https://git.yoctoproject.org' + self.url[26:])
elif self.url.startswith('git://git.kernel.org'):
return 'https' + self.url[3:]
return None
@@ -40,10 +40,10 @@ def set_vcs_fields(layer, repoval):
layer.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
elif repoval.startswith('git://git.yoctoproject.org/'):
reponame = re.sub('^.*/', '', repoval)
- layer.vcs_web_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame
- layer.vcs_web_tree_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_file_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_commit_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/commit/?id=%hash%'
+ layer.vcs_web_url = 'https://git.yoctoproject.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_file_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_commit_url = 'https://git.yoctoproject.org/' + reponame + '/commit/?id=%hash%'
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)
@@ -104,10 +104,10 @@ def main():
layer.vcs_web_commit_url = 'http://cgit.openembedded.org/' + reponame + '/commit/?id=%hash%'
elif repoval.startswith('git://git.yoctoproject.org/'):
reponame = re.sub('^.*/', '', repoval)
- layer.vcs_web_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame
- layer.vcs_web_tree_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_file_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- layer.vcs_web_commit_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/commit/?id=%hash%'
+ layer.vcs_web_url = 'https://git.yoctoproject.org/' + reponame
+ layer.vcs_web_tree_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_file_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ layer.vcs_web_commit_url = 'https://git.yoctoproject.org/' + reponame + '/commit/?id=%hash%'
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)
@@ -55,7 +55,7 @@
<li>Tim Orling</li>
</ul>
-<p>The code is Open Source and can be found on <a href="http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/">git.yoctoproject.org</a>. Patches welcome!</p>
+<p>The code is Open Source and can be found on <a href="https://git.yoctoproject.org/layerindex-web/">git.yoctoproject.org</a>. Patches welcome!</p>
{% endautoescape %}
{% endblock %}
@@ -206,10 +206,10 @@
}
else if( repoval.startsWith('git://git.yoctoproject.org/') ) {
reponame = repoval.replace(/^.*\//, '')
- this.vcs_web_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame
- this.vcs_web_tree_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- this.vcs_web_file_base_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/tree/%path%?h=%branch%'
- this.vcs_web_commit_url = 'http://git.yoctoproject.org/cgit/cgit.cgi/' + reponame + '/commit/?id=%hash%'
+ this.vcs_web_url = 'https://git.yoctoproject.org/' + reponame
+ this.vcs_web_tree_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_file_base_url = 'https://git.yoctoproject.org/' + reponame + '/tree/%path%?h=%branch%'
+ this.vcs_web_commit_url = 'https://git.yoctoproject.org/' + reponame + '/commit/?id=%hash%'
this.vcs_web_type = 'cgit'
}
else if( repoval.startsWith('git://github.com/') ) {
The old /cgit/cgit.cgi/ URL scheme is no longer used by git.yoctoproject.org. Update all references to use the new shorter URLs and switch from http to https. Add a data migration to fix existing LayerItem records in the database. Signed-off-by: Piotr Buliński <piotr@qbee.io> --- README | 2 +- .../0051_fix_yoctoproject_cgit_urls.py | 29 +++++++++++++++++++ layerindex/models.py | 2 +- layerindex/tools/import_layer.py | 8 ++--- layerindex/tools/import_wiki_layers.py | 8 ++--- templates/layerindex/about.html | 2 +- templates/layerindex/editlayer.html | 8 ++--- 7 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 layerindex/migrations/0051_fix_yoctoproject_cgit_urls.py