Skip to content
Snippets Groups Projects
Unverified Commit 4ba70a3f authored by Oliver Smith's avatar Oliver Smith Committed by Luca Weiss
Browse files

git.get_upstream_remote: add fallback code path (MR 2429) (MR 2445)

When running some commands like "pmbootstrap chroot" or even
"pmbootstrap work_migrate", pmbootstrap will attempt to read the
pmaports.cfg from origin/master *before* doing the work dir migration.

In order to do this, the "get_upstream_remote" function tries to find
the upstream remote by URL. Let it search with the outdated URLs too, so
this doesn't fail right before migrating to the new URLs.

(cherry picked from commit a6d34d66)
parent 68150730
No related branches found
No related tags found
1 merge request!2445[2.3.x] Make stable working
Checking pipeline status
......@@ -104,6 +104,15 @@ def get_upstream_remote(args, name_repo):
for line in lines:
if url in line:
return line.split("\t", 1)[0]
# Fallback to old URLs, in case the migration was not done yet
if name_repo == "pmaports":
urls_outdated = OUTDATED_GIT_REMOTES_HTTP
for line in lines:
if any(u in line.lower() for u in urls_outdated):
logging.warning("WARNING: pmaports has an outdated remote URL")
return line.split("\t", 1)[0]
raise RuntimeError("{}: could not find remote name for URL '{}' in git"
" repository: {}".format(name_repo, url, path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment