Skip to content

Commit

Permalink
Add support for sourcehut pages in rDNS check
Browse files Browse the repository at this point in the history
  • Loading branch information
bbhtt committed Aug 8, 2024
1 parent 3da1284 commit 3b76bc6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions flatpak_builder_lint/domainutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"net.sourceforge.",
"org.gnome.gitlab.",
"org.freedesktop.gitlab.",
"site.srht.",
)

REQUEST_TIMEOUT = (120.05, None)
Expand Down Expand Up @@ -146,6 +147,16 @@ def get_proj_url(appid: str) -> str | None:
# not case-sensitive
url = f"sourceforge.net/projects/{second_cpt}/".lower()

if appid.startswith("site.srht."):
second_cpt = demangle(appid.split(".")[2])
if appid.count(".") == 3:
third_cpt = appid.split(".")[3]
# needs root path "/" otherwise HTTP 308
url = f"sr.ht/~{second_cpt}/{third_cpt}/"
else:
third_cpt = demangle(appid.split(".")[3])
url = f"sr.ht/~{second_cpt}/{third_cpt}/"

# not case-sensitive -> lower
elif appid.startswith("io.github."):
second_cpt = demangle(appid.split(".")[2])
Expand Down

0 comments on commit 3b76bc6

Please sign in to comment.