Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bintree: use urllib provided attributes for hostname, user and password #1230

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions lib/portage/dbapi/bintree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,23 +1344,13 @@ def _populate_remote(self, getbinpkg_refresh=True, pretend=False):
for repo in reversed(list(self._binrepos_conf.values())):
base_url = repo.sync_uri
parsed_url = urlparse(base_url)
host = parsed_url.netloc
host = parsed_url.hostname or ""
port = parsed_url.port
user = None
passwd = None
user_passwd = ""
user = parsed_url.username
passwd = parsed_url.password
user_passwd = user + "@" if user else ""
gpkg_only_warned = False

if "@" in host:
user, host = host.split("@", 1)
user_passwd = user + "@"
if ":" in user:
user, passwd = user.split(":", 1)

if port is not None:
port_str = f":{port}"
if host.endswith(port_str):
host = host[: -len(port_str)]
pkgindex_file = os.path.join(
self.settings["EROOT"],
CACHE_PATH,
Expand Down
Loading