diff --git a/craft_archives/repo/apt_sources_manager.py b/craft_archives/repo/apt_sources_manager.py index a5ed639..d506612 100644 --- a/craft_archives/repo/apt_sources_manager.py +++ b/craft_archives/repo/apt_sources_manager.py @@ -203,7 +203,7 @@ def _install_sources_apt( formats=cast(Optional[List[str]], package_repo.formats), name=name, suites=suites, - url=str(package_repo.url).rstrip("/"), + url=str(package_repo.url), keyring_path=keyring_path, ) diff --git a/craft_archives/repo/package_repository.py b/craft_archives/repo/package_repository.py index 5c201a8..0f5e1ca 100644 --- a/craft_archives/repo/package_repository.py +++ b/craft_archives/repo/package_repository.py @@ -237,7 +237,7 @@ class PackageRepositoryApt(PackageRepository): @property def name(self) -> str: """Get the repository name.""" - return re.sub(r"\W+", "_", str(self.url).rstrip("/")) + return re.sub(r"\W+", "_", str(self.url)) @field_validator("url") @classmethod @@ -323,7 +323,7 @@ def unmarshal(cls, data: Mapping[str, Any]) -> "PackageRepositoryApt": @property def pin(self) -> str: """The pin string for this repository if needed.""" - domain = urlparse(str(self.url).rstrip("/")).netloc + domain = urlparse(str(self.url)).netloc return f'origin "{domain}"'