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

MNT: Fix the download url for anaconda/defaults #23

Merged
merged 1 commit into from
Jan 18, 2017
Merged
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
MNT: Fix the download url for anaconda/defaults
Continuum is not redirecting for all packages that are now shown in the
anaconda (defaults) channel on anaconda.org. This special cases the
download url for these channels
ericdill committed Jan 18, 2017
commit ec19438268cb7958837feb35f1a9c11f4b484423
10 changes: 9 additions & 1 deletion conda_mirror/conda_mirror.py
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@
DEFAULT_BAD_LICENSES = ['agpl', '']

DOWNLOAD_URL="https://anaconda.org/{channel}/{name}/{version}/download/{platform}/{file_name}"
# The REPODATA template might break in the future if continuum decides to host
# everything on anaconda/defaults at a different location than all the other
# channels on anaconda.org
REPODATA = 'https://conda.anaconda.org/{channel}/{platform}/repodata.json'
DEFAULT_PLATFORMS = ['linux-64',
'linux-32',
@@ -363,7 +366,12 @@ def main(upstream_channel, target_directory, temp_directory, platform,
# 7. copy new packages to repo directory
# 8. download repodata.json and repodata.json.bz2
# 9. copy new repodata.json and repodata.json.bz2 into the repo

if upstream_channel.lower() in ('anaconda', 'defaults'):
logger.warning("You are attempting to mirror the 'anaconda' or "
"'defaults' channel. Continuum has special cased this "
"channel to redirect to a different download url")
global DOWNLOAD_URL
DOWNLOAD_URL = "https://repo.continuum.io/pkgs/free/{platform}/{file_name}"
# Implementation:
if not os.path.exists(os.path.join(target_directory, platform)):
os.makedirs(os.path.join(target_directory, platform))