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

make last slash in backup sources urls optional #14342

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions conans/client/downloaders/caching_file_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _backup_download(self, backup_url, backups_urls, sha256, cached_path, urls,
don't want silently skipping a backup because it is down.
"""
try:
backup_url = backup_url if backup_url.endswith("/") else backup_url + "/"
self._file_downloader.download(backup_url + sha256, cached_path, sha256=sha256)
self._file_downloader.download(backup_url + sha256 + ".json", cached_path + ".json")
self._output.info(f"Sources for {urls} found in remote backup {backup_url}")
Expand Down
4 changes: 2 additions & 2 deletions conans/test/integration/cache/backup_sources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def source(self):
""")

client.save({"global.conf": f"core.sources:download_cache={download_cache_folder}\n"
f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader/', 'origin']\n"
f"core.sources:upload_url=http://localhost:{http_server.port}/uploader/"},
f"core.sources:download_urls=['http://localhost:{http_server.port}/downloader', 'origin']\n"
f"core.sources:upload_url=http://localhost:{http_server.port}/uploader"},
path=client.cache.cache_folder)

client.save({"conanfile.py": conanfile})
Expand Down