Skip to content

Commit eede516

Browse files
committed
Replace default channel
This commit replaces default channel pointing to packagecontrol.io by a new one from packages.sublimetext.io, effectively next step to sunset old site, which caused some trouble recently.
1 parent 033088d commit eede516

File tree

4 files changed

+10
-21
lines changed

4 files changed

+10
-21
lines changed

Package Control.sublime-settings

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
// The repositories from these channels are placed in order after the
44
// repositories from the "repositories" setting
55
"channels": [
6-
// channel_v4 for python 3.8 compatible libraries to enable plugins
7-
// to migrate to python 3.8 until packagecontrol.io supports new scheme.
8-
// Note: Must always be located before default channel in the list!
9-
// Repo: https://github.com/packagecontrol/channel
10-
"https://packagecontrol.github.io/channel/channel_v4.json",
11-
// default channel for packages
12-
// Repo: https://github.com/wbond/package_control_channel
13-
"https://packagecontrol.io/channel_v3.json"
6+
"https://packages.sublimetext.io/channel.json"
147
],
158

169
// A list of URLs that contain a packages JSON file or point to a

package_control/commands/discover_packages_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ class DiscoverPackagesCommand(sublime_plugin.ApplicationCommand):
99
"""
1010

1111
def run(self):
12-
sublime.run_command('open_url', {'url': 'https://packagecontrol.io/#discover'})
12+
sublime.run_command('open_url', {'url': 'https://packages.sublimetext.io'})

package_control/download_manager.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,6 @@ def update_url(url, debug):
274274
url = url.replace('://nodeload.github.com/', '://codeload.github.com/')
275275
url = re.sub(r'^(https://codeload\.github\.com/[^/#?]+/[^/#?]+/)zipball(/.*)$', '\\1zip\\2', url)
276276

277-
# Fix URLs from old versions of Package Control since we are going to
278-
# remove all packages but Package Control from them to force upgrades
279-
if url == 'https://sublime.wbond.net/repositories.json' or url == 'https://sublime.wbond.net/channel.json':
280-
url = 'https://packagecontrol.io/channel_v3.json'
281-
282277
if debug and url != original_url:
283278
console_write(
284279
'''

package_control/package_manager.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@
4949
from .upgraders.git_upgrader import GitUpgrader
5050
from .upgraders.hg_upgrader import HgUpgrader
5151

52+
DEFAULT_CHANNEL = 'https://packages.sublimetext.io/channel.json'
53+
DEFAULT_CHANNEL_ST3 = 'https://packages.sublimetext.io/channel_st3.json'
5254

53-
DEFAULT_CHANNEL = 'https://packagecontrol.io/channel_v3.json'
5455
OLD_DEFAULT_CHANNELS = set([
56+
'https://packagecontrol.io/channel_v3.json',
5557
'https://packagecontrol.io/channel.json',
5658
'https://sublime.wbond.net/channel.json',
5759
'https://sublime.wbond.net/repositories.json'
@@ -476,6 +478,7 @@ def list_repositories(self):
476478
A list of all available repositories
477479
"""
478480

481+
is_st3 = int(sublime.version()) < 4000
479482
cache_ttl = self.settings.get('cache_length', 300)
480483
channels = self.settings.get('channels', [])
481484
# create copy to prevent backlash to settings object due to being extended
@@ -485,17 +488,15 @@ def list_repositories(self):
485488
found_default = False
486489
for channel in channels:
487490
channel = channel.strip()
488-
489-
if re.match(r'https?://([^.]+\.)*package-control\.io', channel):
490-
console_write('Removed malicious channel %s' % channel)
491-
continue
492-
493-
if channel in OLD_DEFAULT_CHANNELS:
491+
if channel.lower() in OLD_DEFAULT_CHANNELS:
494492
if found_default:
495493
continue
496494
found_default = True
497495
channel = DEFAULT_CHANNEL
498496

497+
if is_st3 and channel.lower() == DEFAULT_CHANNEL:
498+
channel = DEFAULT_CHANNEL_ST3
499+
499500
# Caches various info from channels for performance
500501
cache_key = channel + '.repositories'
501502
if channel[:8].lower() == "file:///":

0 commit comments

Comments
 (0)