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

How to add a custom channel properly #1354

Closed
pjcrosbie opened this issue Apr 13, 2018 · 1 comment
Closed

How to add a custom channel properly #1354

pjcrosbie opened this issue Apr 13, 2018 · 1 comment

Comments

@pjcrosbie
Copy link

This isn't a burning issue because there is an obvious workaround including the repositories directly. However, it would be nice to understand what the issue is if you have the time to point me to my error.

I have created custom channel.json and packages.json files hosted here.

Testing the packages.json repository by directly including it in Package Control.sublime-settings works fine. Packagecontrol finds the repo and package, and I can install it without any issue. This is the work around and I note your recommendation as normal practice from the docs.

However, when I add the channel.json with the raw url to the packages.json repo package control either can't find the repo or can't read it.

Here is the "channels": snippet from Package Control.sublime-settings:

... snip ...
"channels":
  [
    "https://raw.githubusercontent.com/pjc-pub-utils/sublime-packagecontrol/master/channel.json"
  ],
... snip ...

Here is channel.json pointed to by the channel url see url:

{
  "schema_version": "3.0.0",
  "repositories" : [  
    "https://raw.githubusercontent.com/pjc-pub-utils/sublime-packagecontrol/master/packages.json"
  ]
}

I have tried it with and without empty cache items as per issue #815

  "packages_cache": {},
  "dependencies_cache": {}

I have reinstalled package control and I'm running 3.3.0.

Here is the log of install package after reinstalling package control. package control reports no packages available for installation...

>>> import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
286331
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading settings Packages/Package Control/Package Control.sublime-settings
Package Control: Skipping automatic upgrade, last run at 2018-04-12 18:05:10, next run at 2018-04-12 19:05:10 or after
Package Control: Fetching list of available packages and dependencies
  Platform: windows-x64
  Sublime Text Version: 3143
  Package Control Version: 3.3.0
Package Control: Download Debug
  URL: https://raw.githubusercontent.com/pjc-pub-utils/sublime-packagecontrol/master/channel.json
  Timeout: 30
  Resolved IP: 151.101.0.133
Package Control: WinINet Debug Proxy
  proxy: 
  proxy bypass: 
  proxy username: 
  proxy password: 
Package Control: WinINet HTTPS Debug General
  Server SSL Certificate:
    subject: US, California, San Francisco, "GitHub, Inc.", www.github.com
    issuer: US, DigiCert Inc, www.digicert.com, DigiCert SHA2 High Assurance Server CA
    common name: www.github.com
    issue date: Wed, 22 Mar 2017 17:00:00 GMT
    expire date: Wed, 13 May 2020 05:00:00 GMT
Package Control: WinINet HTTPS Debug Write
  GET /pjc-pub-utils/sublime-packagecontrol/master/channel.json HTTP/1.1
  User-Agent: Package Control v3.3.0
  Host: raw.githubusercontent.com
  Connection: Keep-Alive
  Cache-Control: no-cache
  Accept-Encoding: bzip2,gzip,deflate
Package Control: WinINet HTTPS Debug Read
  HTTP/1.1 200 OK
  Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
  Strict-Transport-Security: max-age=31536000
  X-Content-Type-Options: nosniff
  X-Frame-Options: deny
  X-XSS-Protection: 1; mode=block
  ETag: "22440481c3c7fa09e0caff49315949a57271290f"
  Content-Type: text/plain; charset=utf-8
  Cache-Control: max-age=300
  X-Geo-Block-List: 
  X-GitHub-Request-Id: AD7C:300C:55400D:5BD77D:5AD00C8F
  Content-Encoding: gzip
  Content-Length: 147
  Accept-Ranges: bytes
  Date: Fri, 13 Apr 2018 01:49:06 GMT
  Via: 1.1 varnish
  Connection: keep-alive
  X-Served-By: cache-sjc3134-SJC
  X-Cache: MISS
  X-Cache-Hits: 0
  X-Timer: S1523584146.038910,VS0,VE138
  Vary: Authorization,Accept-Encoding
  Access-Control-Allow-Origin: *
  X-Fastly-Request-ID: 84e4b1caab8acfd49c7f6754d76a54b8019c5359
  Expires: Fri, 13 Apr 2018 01:54:06 GMT
  Source-Age: 0
Package Control: Caching https://raw.githubusercontent.com/pjc-pub-utils/sublime-packagecontrol/master/channel.json in B:\bin\sublime_text3\Data\Packages\User\Package Control.cache\ec04b71808abf3298d52cb1010eae9fa
Package Control: WinINet HTTPS Debug General
  Closing connection to raw.githubusercontent.com on port 443 after 1 request
@eugenesvk
Copy link

FYI the reason is likely that channels don't work without package_cache, there is a workaround described here #1601, though hopefully it might some day be fixed or at least properly documented

@deathaxe deathaxe added this to the Package Control 4.0 milestone Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants