Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit c1b08cf

Browse files
peat-psuwitUniversalSuperBox
authored andcommitted
Choose the correct base for repo
Base-less PRs are now (accidentally) published on repo2 only. So let's head that direction. It'll also choose the correct base for focal repos.
1 parent ae840a4 commit c1b08cf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ubports-qa

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,20 @@ def list_lists():
118118
]
119119

120120

121+
def repo_base(repo: str):
122+
if repo.startswith("xenial"):
123+
return "http://repo.ubports.com/"
124+
else: # This includes base-less PRs
125+
return "http://repo2.ubports.com/"
126+
121127
def add_list(branch):
122128
if list_exists(branch):
123129
return
124-
if requests.get("http://repo.ubports.com/dists/" + branch).status_code != 200:
130+
base = repo_base(branch)
131+
if requests.head("{}dists/{}/".format(base, branch) ).status_code != 200:
125132
die("PPA not found")
126133
with open(get_list_file(branch), "w+") as repo_list:
127-
repo_list.write("deb http://repo.ubports.com/ {} main".format(branch))
134+
repo_list.write("deb {} {} main".format(base, branch))
128135

129136

130137
def add_pref(branch):

0 commit comments

Comments
 (0)