Commit 308886ed authored by Jelmer Vernooij's avatar Jelmer Vernooij

Update canonical Git URLs on Salsa.

parent f15c9fd8
Pipeline #85064 passed with stages
in 9 minutes and 7 seconds
......@@ -2,6 +2,7 @@
from lintian_brush.control import update_control
import re
from urllib.parse import urlparse, urlunparse
def canonicalize_vcs_browser_url(url):
......@@ -30,8 +31,19 @@ def canonicalize_vcs_browser_url(url):
return url
def canonical_vcs_git_url(url):
parsed_url = urlparse(url)
if parsed_url.netloc == 'salsa.debian.org':
if not parsed_url.path.rstrip('/').endswith('.git'):
parsed_url = parsed_url._replace(
path=parsed_url.path.rstrip('/') + '.git')
return urlunparse(parsed_url)
return url
canonicalize_vcs = {
'Browser': canonicalize_vcs_browser_url,
'Git': canonical_vcs_git_url,
}
fields = set()
......
Source: blah
Vcs-Git: https://salsa.debian.org/blah/blah
Package: blah
Description: Testing
Test test
Use canonical URL in Vcs-Git.
Fixed-Lintian-Tags: vcs-field-not-canonical
Source: blah
Vcs-Git: https://salsa.debian.org/blah/blah.git
Package: blah
Description: Testing
Test test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment