Merge pull request #83119 from ryneeverett/vim-plugins-update-redirects

VimPlugins: update redirected repos
gstqt5
Timo Kaufmann 2020-03-27 17:48:32 +00:00 committed by GitHub
commit 12c931a8e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 222 additions and 130 deletions

View File

@ -30,9 +30,13 @@ let
(removeRecurseForDerivations
(checkInPkgs n alias)))
aliases;
in
mapAliases {
deprecations = lib.mapAttrs (old: info:
throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
in
mapAliases ({
airline = vim-airline;
alternative = a-vim; # backwards compat, added 2014-10-21
bats = bats-vim;
@ -68,7 +72,7 @@ mapAliases {
ghc-mod-vim = ghcmod-vim;
ghcmod = ghcmod-vim;
goyo = goyo-vim;
Gist = gist-vim;
Gist = vim-gist;
gitgutter = vim-gitgutter;
gundo = gundo-vim;
Gundo = gundo-vim; # backwards compat, added 2015-10-03
@ -134,7 +138,6 @@ mapAliases {
wombat256 = wombat256-vim; # backwards compat, added 2015-7-8
yankring = YankRing-vim;
Yankring = YankRing-vim;
YouCompleteMe = youcompleteme;
xterm-color-table = xterm-color-table-vim;
zeavim = zeavim-vim;
}
} // deprecations)

View File

@ -11,7 +11,6 @@ let
# TL;DR
# * Add your plugin to ./vim-plugin-names
# * sort -udf ./vim-plugin-names > sorted && mv sorted vim-plugin-names
# * run ./update.py
#
# If additional modifications to the build process are required,

View File

@ -0,0 +1,18 @@
{
"gist-vim": {
"date": "2020-03-27",
"new": "vim-gist"
},
"vim-jade": {
"date": "2020-03-27",
"new": "vim-pug"
},
"vundle": {
"date": "2020-03-27",
"new": "Vundle.vim"
},
"youcompleteme": {
"date": "2020-03-27",
"new": "YouCompleteMe"
}
}

View File

@ -63,7 +63,7 @@ let
pname = "ale";
version = "2020-03-11";
src = fetchFromGitHub {
owner = "w0rp";
owner = "dense-analysis";
repo = "ale";
rev = "bbe5153fcb36dec9860ced33ae8ff0b5d76ac02a";
sha256 = "1xvmh66lgii98z6f4lk1mjs73ysrvs55xdlcmf224k3as822jmw0";
@ -305,7 +305,7 @@ let
pname = "clang_complete";
version = "2018-09-19";
src = fetchFromGitHub {
owner = "Rip-Rip";
owner = "xavierd";
repo = "clang_complete";
rev = "0b98d7533ad967aac3fc4c1a5b0508dafa8a676f";
sha256 = "04mdhc1kbv66blkn6qn98iyj659dac4z49nmpf3anglz8dgcxjgc";
@ -644,12 +644,12 @@ let
coc-tsserver = buildVimPluginFrom2Nix {
pname = "coc-tsserver";
version = "2020-03-09";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "neoclide";
repo = "coc-tsserver";
rev = "dae0cc36b0245a601d4431ae8dd2319eaa919058";
sha256 = "1559c0hwyknz1j6vbigywg1fjads4wf8by59z0sri6aah9q77q2z";
rev = "54bea1ec1ab44802a155f876a4d1cc2c44b2bc42";
sha256 = "0npjc7c3x9mdqc6asav1f2wwv4p6lb5hk7c1p9b7m3vjg21w0k22";
};
};
@ -922,7 +922,7 @@ let
pname = "denite-extra";
version = "2019-03-29";
src = fetchFromGitHub {
owner = "chemzqm";
owner = "neoclide";
repo = "denite-extra";
rev = "af18257544027ce89269dba70c12aba1f5b9e23c";
sha256 = "0bmq9yhylfd3v6bfwvakw3pbsz5kk8wlmmql0yllqayp6410w25a";
@ -933,7 +933,7 @@ let
pname = "denite-git";
version = "2020-03-02";
src = fetchFromGitHub {
owner = "chemzqm";
owner = "neoclide";
repo = "denite-git";
rev = "88b5323a6fc0ace197eed5205215d80f3b613f91";
sha256 = "0b687i64hr8hll7pv7r1xz906b46cl2q62zm18ipikhkpva6iv13";
@ -942,12 +942,12 @@ let
denite-nvim = buildVimPluginFrom2Nix {
pname = "denite-nvim";
version = "2020-03-18";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "Shougo";
repo = "denite.nvim";
rev = "a184e87b7df5e8f35aee115153b37f178e47718c";
sha256 = "1na637k62sgpqx69r6j5prad4qdc9dp3psq75jhqyvhm3yq2432w";
rev = "c3206a06508a197650ee4e1d85da39ff24e3a56b";
sha256 = "1yy6j5zpja8jr1j8sghwc1l0fkb47r8cvv36ckf75x9x5gpylb5m";
};
};
@ -966,7 +966,7 @@ let
pname = "deoplete-clang";
version = "2019-11-10";
src = fetchFromGitHub {
owner = "zchee";
owner = "deoplete-plugins";
repo = "deoplete-clang";
rev = "2ea262e98edcb66e828f9077fcc844100320eb63";
sha256 = "1wvk61f8ph2vpl6llzmir3qs3zwaw3lrphs16d1j7ljkdl3bk49k";
@ -1022,7 +1022,7 @@ let
pname = "deoplete-go";
version = "2020-01-01";
src = fetchFromGitHub {
owner = "zchee";
owner = "deoplete-plugins";
repo = "deoplete-go";
rev = "4f1ccd2ed70211fd025d052ec725c0b835bea487";
sha256 = "0zmx98kz6pxfpakizr8xm1nrv1rjr0frz19pkik29mk6aj2b2l08";
@ -1154,12 +1154,12 @@ let
deoplete-nvim = buildVimPluginFrom2Nix {
pname = "deoplete-nvim";
version = "2020-03-18";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "Shougo";
repo = "deoplete.nvim";
rev = "db7d2dc5f416634c9917054bcd6e1e5d925bb4d7";
sha256 = "1d34zy81j47icsrnbxpp4x9f35ihrmd0lnd0vphi216kdlkxk37b";
rev = "1439c621dc94016c504e1732ce8270081a42768f";
sha256 = "1c8qx839zmf52cfazlbbnlhxw6cvnsr3ds0rclawgycbl4s1qy8f";
};
};
@ -1430,17 +1430,6 @@ let
};
};
gist-vim = buildVimPluginFrom2Nix {
pname = "gist-vim";
version = "2020-01-29";
src = fetchFromGitHub {
owner = "mattn";
repo = "gist-vim";
rev = "2158eceb210b0a354bc17aa4144554e5d8bb6c79";
sha256 = "1dz33c63q7gghz35hyrvbshqw20faccs7bvxlda5w70mkbz9h9c4";
};
};
gitignore-vim = buildVimPluginFrom2Nix {
pname = "gitignore-vim";
version = "2014-03-16";
@ -2060,12 +2049,12 @@ let
neoformat = buildVimPluginFrom2Nix {
pname = "neoformat";
version = "2020-03-03";
version = "2020-03-20";
src = fetchFromGitHub {
owner = "sbdchd";
repo = "neoformat";
rev = "69140aedb7da5a5a0b25b82e7f756f91d08170ea";
sha256 = "132ksy20rb01xm18zwwl3lv5zapfhfvaf5zz6md8dnr5hvkvvrgx";
rev = "d02b169e70bd6d2b2365bf6cda721967616a30bf";
sha256 = "1cya26wfqc7l7dqy854m4kwrq3w66knmn2cgviqh9cnsjzhwxs0d";
};
};
@ -2183,7 +2172,7 @@ let
pname = "nerdcommenter";
version = "2020-02-19";
src = fetchFromGitHub {
owner = "scrooloose";
owner = "preservim";
repo = "nerdcommenter";
rev = "c62e618a1ab5a50a4028e3296500ba29d9b033d8";
sha256 = "0w4bxj423dxxkcxnfmipf8x5jfm058rq4g3m98wzcz5zbambv3qs";
@ -2194,7 +2183,7 @@ let
pname = "nerdtree";
version = "2020-02-20";
src = fetchFromGitHub {
owner = "scrooloose";
owner = "preservim";
repo = "nerdtree";
rev = "e67324fdea7a192c7ce1b4c6b3c3b9f82f11eee7";
sha256 = "0y7hd69k0i21cqgs11n80ljv6cl0gfcjjwa0dvdywpd8mmn1ad4k";
@ -2291,12 +2280,12 @@ let
nvim-lsp = buildVimPluginFrom2Nix {
pname = "nvim-lsp";
version = "2020-03-19";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "neovim";
repo = "nvim-lsp";
rev = "6d5e81c71bb90568b3bf9ca061980b9b30cdbc15";
sha256 = "1va480pw7nk650bmh4z7rvr2a5sqd4q86y19341p6mj12p2r2fcv";
rev = "4fe58ec4e1fa3500c7ef98464174bf6c4cb8ce67";
sha256 = "1xyqbr0f2pgvbbk0cpg92pswavff910hy8rjkm05grhqw43vkzcg";
};
};
@ -2480,7 +2469,7 @@ let
pname = "purescript-vim";
version = "2018-12-10";
src = fetchFromGitHub {
owner = "raichoo";
owner = "purescript-contrib";
repo = "purescript-vim";
rev = "67ca4dc4a0291e5d8c8da48bffc0f3d2c9739e7f";
sha256 = "1insh39hzbynr6qxb215qxhpifl5m8i5i0d09a3b6v679i7s11i8";
@ -2623,7 +2612,7 @@ let
pname = "riv-vim";
version = "2020-02-17";
src = fetchFromGitHub {
owner = "Rykka";
owner = "gu-fan";
repo = "riv.vim";
rev = "d52844691ca2f139e4b634db65aa49c57a0fc2b3";
sha256 = "0s4jvqwlnmmh2zw9v9rlwynwx44ypdrzhhyfb20sippxg9g6z0c5";
@ -2854,7 +2843,7 @@ let
pname = "sved";
version = "2019-01-25";
src = fetchFromGitHub {
owner = "peder2tm";
owner = "peterbjorgensen";
repo = "sved";
rev = "3362db72447e8ac812c7299c15ecfc9f41341713";
sha256 = "1r2nv069d6r2q6gbiz795x94mfjm9hnv05zka085hhq9a3yf1pgx";
@ -2876,7 +2865,7 @@ let
pname = "syntastic";
version = "2020-01-29";
src = fetchFromGitHub {
owner = "scrooloose";
owner = "vim-syntastic";
repo = "syntastic";
rev = "f3766538720116f099a8b1517f76ae2f094afd20";
sha256 = "1bzjav87fcibwlp8siqnx6x8wv8w3mwrrqrd5w19ny9scr5x2a65";
@ -3601,12 +3590,12 @@ let
vim-codefmt = buildVimPluginFrom2Nix {
pname = "vim-codefmt";
version = "2020-02-26";
version = "2020-03-20";
src = fetchFromGitHub {
owner = "google";
repo = "vim-codefmt";
rev = "6d69f933f243ed3d7797641bd41c0e65d245c931";
sha256 = "0vzzyz7v03ihky3vx12rji4l1r6vbxgslvc1fvi4dznfqn5m9gfn";
rev = "d6676620f7a85fa49e8893cad041df59497fd845";
sha256 = "01wrlq9h2wzngi8qna0zrwycrp0iqp7qsijyby287zbckrs25rnd";
};
};
@ -3900,7 +3889,7 @@ let
pname = "vim-elixir";
version = "2020-03-11";
src = fetchFromGitHub {
owner = "elixir-lang";
owner = "elixir-editors";
repo = "vim-elixir";
rev = "088cfc407460dea7b81c10b29db23843f85e7919";
sha256 = "1w9w4arzlbjhd5kcvyv5fykq9djc4n4j1nc75qqlzsfggbjjwhbk";
@ -4074,11 +4063,11 @@ let
vim-fugitive = buildVimPluginFrom2Nix {
pname = "vim-fugitive";
version = "2020-03-12";
version = "2020-03-22";
src = fetchFromGitHub {
owner = "tpope";
repo = "vim-fugitive";
rev = "9a4d730270882f9d39a411eb126143eda4d46963";
rev = "0e35c9bbc78159318e7b7ffd228f09a96afb8fde";
sha256 = "098fz3lmfysv6gr5cjwgqsdzxjxygwc0x4ak1sxj3h6djys5x66b";
};
};
@ -4094,6 +4083,17 @@ let
};
};
vim-gist = buildVimPluginFrom2Nix {
pname = "vim-gist";
version = "2020-01-29";
src = fetchFromGitHub {
owner = "mattn";
repo = "vim-gist";
rev = "2158eceb210b0a354bc17aa4144554e5d8bb6c79";
sha256 = "1dz33c63q7gghz35hyrvbshqw20faccs7bvxlda5w70mkbz9h9c4";
};
};
vim-gista = buildVimPluginFrom2Nix {
pname = "vim-gista";
version = "2020-01-04";
@ -4151,12 +4151,12 @@ let
vim-go = buildVimPluginFrom2Nix {
pname = "vim-go";
version = "2020-03-17";
version = "2020-03-20";
src = fetchFromGitHub {
owner = "fatih";
repo = "vim-go";
rev = "f5d34f40d6757470f40600000c9c08de142d7ced";
sha256 = "0a2g8f9xza2m07qm4pcj2aqjh1yvs9cxn8f3zima06swfw2ahdh8";
rev = "50d52bafa00448ca8cde2b0e05b0fe71c9397762";
sha256 = "1c8dwllscwxiqp409zy7ajwz84bn8g7p9gldqrhx8i9l7q382z0w";
};
};
@ -4413,17 +4413,6 @@ let
};
};
vim-jade = buildVimPluginFrom2Nix {
pname = "vim-jade";
version = "2019-09-23";
src = fetchFromGitHub {
owner = "digitaltoad";
repo = "vim-jade";
rev = "ea39cd942cf3194230cf72bfb838901a5344d3b3";
sha256 = "07141jkfnaia4ydc6qcg0bc06w720l2lzl7bm4bsjwswqrzmhfam";
};
};
vim-janah = buildVimPluginFrom2Nix {
pname = "vim-janah";
version = "2018-10-01";
@ -4647,12 +4636,12 @@ let
vim-lsc = buildVimPluginFrom2Nix {
pname = "vim-lsc";
version = "2020-02-11";
version = "2020-03-22";
src = fetchFromGitHub {
owner = "natebosch";
repo = "vim-lsc";
rev = "62c6f6aa227b1b3ef5e7cf7df9f0a9c1d855d7fe";
sha256 = "1qimz08rqm4ch6dr0znwxl328593kmz0yxdqq15g1yrw4ig0fi22";
rev = "3dd7a19e8689847956266e0be1bbfb4ca12da746";
sha256 = "0dj1b8v9iz67m833x1z3s7jac0jpfxgs43ylc6m0v3al67qcb0mj";
};
};
@ -5085,6 +5074,17 @@ let
};
};
vim-pug = buildVimPluginFrom2Nix {
pname = "vim-pug";
version = "2019-09-23";
src = fetchFromGitHub {
owner = "digitaltoad";
repo = "vim-pug";
rev = "ea39cd942cf3194230cf72bfb838901a5344d3b3";
sha256 = "07141jkfnaia4ydc6qcg0bc06w720l2lzl7bm4bsjwswqrzmhfam";
};
};
vim-puppet = buildVimPluginFrom2Nix {
pname = "vim-puppet";
version = "2019-09-16";
@ -5560,12 +5560,12 @@ let
vim-test = buildVimPluginFrom2Nix {
pname = "vim-test";
version = "2020-03-17";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "janko-m";
owner = "janko";
repo = "vim-test";
rev = "d878e9d61f186140f18a7a8a8badc0605d8955ba";
sha256 = "06kihjif3g00bibx304vz22w2w9z84v0g6a55cxs1hqlc4ygnl8v";
rev = "b302a325116d8708dc0721b7cd97ff59536f4e75";
sha256 = "099dzadzhfkhf92lv5cmfk0iawbp40v1rz9xxp462hxxcn3p3c97";
};
};
@ -5978,12 +5978,12 @@ let
vimtex = buildVimPluginFrom2Nix {
pname = "vimtex";
version = "2020-03-17";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "lervag";
repo = "vimtex";
rev = "16b23314b31862510d3feb8a2569199062b083ac";
sha256 = "0vibfwsyamp4jqbaaa872m922yg89fx7k0cfa6kfhr5ks4vhpya5";
rev = "8c59031d50feeec8b4f3549f70f82564975265f0";
sha256 = "16a7qpp19gci8hq8h2999pwv0gd6x0mqgifv325mlb0jj5lxy7m1";
};
};
@ -6031,12 +6031,12 @@ let
};
};
vundle = buildVimPluginFrom2Nix {
pname = "vundle";
Vundle-vim = buildVimPluginFrom2Nix {
pname = "Vundle-vim";
version = "2019-08-17";
src = fetchFromGitHub {
owner = "gmarik";
repo = "vundle";
owner = "VundleVim";
repo = "Vundle.vim";
rev = "b255382d6242d7ea3877bf059d2934125e0c4d95";
sha256 = "0fkmklcq3fgvd6x6irz9bgyvcdaxafykk3k89gsi9p6b0ikw3rw6";
};
@ -6132,22 +6132,22 @@ let
yats-vim = buildVimPluginFrom2Nix {
pname = "yats-vim";
version = "2020-03-02";
version = "2020-03-21";
src = fetchFromGitHub {
owner = "HerringtonDarkholme";
repo = "yats.vim";
rev = "68ef9623656fe9aaa53c1d9ab906f09c2c095f06";
sha256 = "0cn1k8lda71vm4gx14ly9gdvk1j17jds0axx9jvjp4w9jid6ksqk";
rev = "4d3f69a3a5f56bae9475a96c3291ffdcbd9ff0b1";
sha256 = "0f3dq4lrm9xzh780fd471b7ddibfzb9vfq1k6gn53pmqpiw6a498";
fetchSubmodules = true;
};
};
youcompleteme = buildVimPluginFrom2Nix {
pname = "youcompleteme";
YouCompleteMe = buildVimPluginFrom2Nix {
pname = "YouCompleteMe";
version = "2020-03-18";
src = fetchFromGitHub {
owner = "valloric";
repo = "youcompleteme";
owner = "ycm-core";
repo = "YouCompleteMe";
rev = "cf4a76acaeed27eb3ca1dca5adf1115b6abbcfa3";
sha256 = "0si9by2ag2f7xgxidp5215d6wkg1mdhq9j5c4icdpsly9gv3w5s8";
fetchSubmodules = true;
@ -6191,7 +6191,7 @@ let
pname = "zig-vim";
version = "2020-02-10";
src = fetchFromGitHub {
owner = "zig-lang";
owner = "ziglang";
repo = "zig.vim";
rev = "55b690029791022fd7818ebd0ee395e8976899fe";
sha256 = "10xkrn4yhjda187mpw1y3qw0s6bp7aklk87pansaa3fvysdf3b6c";

View File

@ -393,7 +393,7 @@ self: super: {
configurePhase = "cd plugins/nvim";
});
gist-vim = super.gist-vim.overrideAttrs(old: {
vim-gist = super.vim-gist.overrideAttrs(old: {
dependencies = with super; [ webapi-vim ];
});
@ -640,7 +640,7 @@ self: super: {
sourceRoot = ".";
});
youcompleteme = super.youcompleteme.overrideAttrs(old: {
YouCompleteMe = super.YouCompleteMe.overrideAttrs(old: {
buildPhase = ''
substituteInPlace plugin/youcompleteme.vim \
--replace "'ycm_path_to_python_interpreter', '''" \

View File

@ -10,12 +10,14 @@
import argparse
import functools
import http
import json
import os
import subprocess
import sys
import traceback
import urllib.error
import urllib.parse
import urllib.request
import xml.etree.ElementTree as ET
from datetime import datetime
@ -32,6 +34,7 @@ ATOM_UPDATED = "{http://www.w3.org/2005/Atom}updated" # "
ROOT = Path(__file__).parent
DEFAULT_IN = ROOT.joinpath("vim-plugin-names")
DEFAULT_OUT = ROOT.joinpath("generated.nix")
DEPRECATED = ROOT.joinpath("deprecated.json")
import time
from functools import wraps
@ -71,9 +74,11 @@ def retry(ExceptionToCheck: Any, tries: int = 4, delay: float = 3, backoff: floa
class Repo:
def __init__(self, owner: str, name: str) -> None:
def __init__(self, owner: str, name: str, alias: str) -> None:
self.owner = owner
self.name = name
self.alias = alias
self.redirect: Dict[str, str] = {}
def url(self, path: str) -> str:
return urljoin(f"https://github.com/{self.owner}/{self.name}/", path)
@ -96,7 +101,9 @@ class Repo:
@retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
def latest_commit(self) -> Tuple[str, datetime]:
with urllib.request.urlopen(self.url("commits/master.atom"), timeout=10) as req:
commit_url = self.url("commits/master.atom")
with urllib.request.urlopen(commit_url, timeout=10) as req:
self.check_for_redirect(commit_url, req)
xml = req.read()
root = ET.fromstring(xml)
latest_entry = root.find(ATOM_ENTRY)
@ -111,6 +118,19 @@ class Repo:
updated = datetime.strptime(updated_tag.text, "%Y-%m-%dT%H:%M:%SZ")
return Path(str(url.path)).name, updated
def check_for_redirect(self, url: str, req: http.client.HTTPResponse):
response_url = req.geturl()
if url != response_url:
new_owner, new_name = (
urllib.parse.urlsplit(response_url).path.strip("/").split("/")[:2]
)
end_line = "\n" if self.alias is None else f" as {self.alias}\n"
plugin_line = "{owner}/{name}" + end_line
old_plugin = plugin_line.format(owner=self.owner, name=self.name)
new_plugin = plugin_line.format(owner=new_owner, name=new_name)
self.redirect[old_plugin] = new_plugin
def prefetch_git(self, ref: str) -> str:
data = subprocess.check_output(
["nix-prefetch-git", "--fetch-submodules", self.url(""), ref]
@ -197,15 +217,17 @@ def get_current_plugins() -> List[Plugin]:
return plugins
def prefetch_plugin(user: str, repo_name: str, alias: str, cache: "Cache") -> Plugin:
repo = Repo(user, repo_name)
def prefetch_plugin(
user: str, repo_name: str, alias: str, cache: "Cache"
) -> Tuple[Plugin, Dict[str, str]]:
repo = Repo(user, repo_name, alias)
commit, date = repo.latest_commit()
has_submodules = repo.has_submodules()
cached_plugin = cache[commit]
if cached_plugin is not None:
cached_plugin.name = alias or repo_name
cached_plugin.date = date
return cached_plugin
return cached_plugin, repo.redirect
print(f"prefetch {user}/{repo_name}")
if has_submodules:
@ -213,7 +235,10 @@ def prefetch_plugin(user: str, repo_name: str, alias: str, cache: "Cache") -> Pl
else:
sha256 = repo.prefetch_github(commit)
return Plugin(alias or repo_name, commit, has_submodules, sha256, date=date)
return (
Plugin(alias or repo_name, commit, has_submodules, sha256, date=date),
repo.redirect,
)
def print_download_error(plugin: str, ex: Exception):
@ -227,20 +252,22 @@ def print_download_error(plugin: str, ex: Exception):
def check_results(
results: List[Tuple[str, str, Union[Exception, Plugin]]]
) -> List[Tuple[str, str, Plugin]]:
results: List[Tuple[str, str, Union[Exception, Plugin], Dict[str, str]]]
) -> Tuple[List[Tuple[str, str, Plugin]], Dict[str, str]]:
failures: List[Tuple[str, Exception]] = []
plugins = []
for (owner, name, result) in results:
redirects: Dict[str, str] = {}
for (owner, name, result, redirect) in results:
if isinstance(result, Exception):
failures.append((name, result))
else:
plugins.append((owner, name, result))
redirects.update(redirect)
print(f"{len(results) - len(failures)} plugins were checked", end="")
if len(failures) == 0:
print()
return plugins
return plugins, redirects
else:
print(f", {len(failures)} plugin(s) could not be downloaded:\n")
@ -328,15 +355,15 @@ class Cache:
def prefetch(
args: Tuple[str, str, str], cache: Cache
) -> Tuple[str, str, Union[Exception, Plugin]]:
) -> Tuple[str, str, Union[Exception, Plugin], dict]:
assert len(args) == 3
owner, repo, alias = args
try:
plugin = prefetch_plugin(owner, repo, alias, cache)
plugin, redirect = prefetch_plugin(owner, repo, alias, cache)
cache[plugin.commit] = plugin
return (owner, repo, plugin)
return (owner, repo, plugin, redirect)
except Exception as e:
return (owner, repo, e)
return (owner, repo, e, {})
header = (
@ -386,6 +413,49 @@ in lib.fix' (lib.extends overrides packages)
print(f"updated {outfile}")
def rewrite_input(input_file: Path, output_file: Path, redirects: dict):
with open(input_file, "r") as f:
lines = f.readlines()
if redirects:
lines = [redirects.get(line, line) for line in lines]
cur_date_iso = datetime.now().strftime("%Y-%m-%d")
with open(DEPRECATED, "r") as f:
deprecations = json.load(f)
for old, new in redirects.items():
old_name = old.split("/")[1].split(" ")[0].strip("\n")
new_name = new.split("/")[1].split(" ")[0].strip("\n")
if old_name != new_name:
deprecations[old_name] = {
"new": new_name,
"date": cur_date_iso,
}
with open(DEPRECATED, "w") as f:
json.dump(deprecations, f, indent=4, sort_keys=True)
print(
f"""\
Redirects have been detected and {input_file} has been updated. Please take the
following steps:
1. Go ahead and commit just the updated expressions as you intended to do:
git add {output_file}
git commit -m "vimPlugins: Update"
2. Run this script again so these changes will be reflected in the
generated expressions:
./update.py
3. Commit {input_file} along with deprecations and generated expressions:
git add {output_file} {input_file} {DEPRECATED}
git commit -m "vimPlugins: Update redirects"
"""
)
lines = sorted(lines, key=str.casefold)
with open(input_file, "w") as f:
f.writelines(lines)
def parse_args():
parser = argparse.ArgumentParser(
description=(
@ -428,10 +498,12 @@ def main() -> None:
finally:
cache.store()
plugins = check_results(results)
plugins, redirects = check_results(results)
generate_nix(plugins, args.outfile)
rewrite_input(args.input_file, args.outfile, redirects)
if __name__ == "__main__":
main()

View File

@ -21,8 +21,8 @@ autozimu/LanguageClient-neovim
ayu-theme/ayu-vim
bazelbuild/vim-bazel
bbchung/clighter8
benmills/vimux
benizi/vim-automkdir
benmills/vimux
bhurlow/vim-parinfer
bitc/vim-hdevtools
bkad/camelcasemotion
@ -36,8 +36,6 @@ brooth/far.vim
carlitux/deoplete-ternjs
ccarpita/rtorrent-syntax-file
cespare/vim-toml
chemzqm/denite-extra
chemzqm/denite-git
Chiel92/vim-autoformat
chikatoike/concealedyank.vim
chikatoike/sourcemap.vim
@ -58,22 +56,25 @@ cocopon/iceberg.vim
cohama/lexima.vim
ctjhoa/spacevim
ctrlpvim/ctrlp.vim
dag/vim2hs
dag/vim-fish
dag/vim2hs
dannyob/quickfixstatus
darfink/starsearch.vim
dart-lang/dart-vim-plugin
david-a-wheeler/vim-metamath
davidhalter/jedi-vim
dcharbon/vim-flatbuffers
dense-analysis/ale
deoplete-plugins/deoplete-clang
deoplete-plugins/deoplete-dictionary
deoplete-plugins/deoplete-go
deoplete-plugins/deoplete-jedi
deoplete-plugins/deoplete-zsh
derekelkins/agda-vim
derekwyatt/vim-scala
dhruvasagar/vim-prosession
dhruvasagar/vim-table-mode
digitaltoad/vim-jade
digitaltoad/vim-pug
direnv/direnv.vim
dleonard0/pony-vim-syntax
dracula/vim
@ -86,7 +87,7 @@ easymotion/vim-easymotion
editorconfig/editorconfig-vim
ehamberg/vim-cute-python
eikenb/acp
elixir-lang/vim-elixir
elixir-editors/vim-elixir
elmcast/elm-vim
elzr/vim-json
embear/vim-localvimrc
@ -109,7 +110,6 @@ garbas/vim-snipmate
gentoo/gentoo-syntax
gibiansky/vim-textobj-haskell
glts/vim-textobj-comment
gmarik/vundle
godlygeek/csapprox
godlygeek/tabular
google/vim-codefmt
@ -118,6 +118,7 @@ google/vim-maktaba
gorkunov/smartpairs.vim
gotcha/vimelette
gregsexton/gitv
gu-fan/riv.vim
guns/vim-clojure-highlight
guns/vim-clojure-static
guns/vim-sexp
@ -148,7 +149,7 @@ itchyny/vim-cursorword
itchyny/vim-gitbranch
ivanov/vim-ipython
jacoborus/tender.vim
janko-m/vim-test
janko/vim-test
jaredgorski/SpaceCamp
JazzCore/ctrlp-cmatcher
jceb/vim-hier
@ -260,7 +261,7 @@ markonm/traces.vim
martinda/Jenkinsfile-vim-syntax
mattn/calendar-vim as mattn-calendar-vim
mattn/emmet-vim
mattn/gist-vim
mattn/vim-gist
mattn/webapi-vim
matze/vim-move
maximbaz/lightline-ale
@ -315,8 +316,8 @@ neoclide/coc-neco
neoclide/coc-pairs
neoclide/coc-prettier
neoclide/coc-python
neoclide/coc-rls
neoclide/coc-r-lsp
neoclide/coc-rls
neoclide/coc-smartf
neoclide/coc-snippets
neoclide/coc-solargraph
@ -330,12 +331,14 @@ neoclide/coc-vimtex
neoclide/coc-wxml
neoclide/coc-yaml
neoclide/coc-yank
neoclide/denite-extra
neoclide/denite-git
neoclide/vim-easygit
neomake/neomake
neovim/nvim-lsp
neovim/nvimdev.nvim
neovimhaskell/haskell-vim
neovimhaskell/nvim-hs.vim
neovim/nvimdev.nvim
neovim/nvim-lsp
neutaaaaan/iosvkem
nfnty/vim-nftables
nicoe/deoplete-khard
@ -356,7 +359,7 @@ osyo-manga/vim-watchdogs
pangloss/vim-javascript
parsonsmatt/intero-neovim
pearofducks/ansible-vim
peder2tm/sved
peterbjorgensen/sved
peterhoeg/vim-qml
phanviet/vim-monokai-pro
plasticboy/vim-markdown
@ -364,7 +367,10 @@ ponko2/deoplete-fish
posva/vim-vue
powerman/vim-plugin-AnsiEsc
PProvost/vim-ps1
preservim/nerdcommenter
preservim/nerdtree
ptzz/lf.vim
purescript-contrib/purescript-vim
python-mode/python-mode
qnighy/lalrpop.vim
qpkorr/vim-bufkill
@ -373,7 +379,6 @@ racer-rust/vim-racer
rafaqz/ranger.vim
rafi/awesome-vim-colorschemes
raghur/vim-ghost
raichoo/purescript-vim
Raimondi/delimitMate
rakr/vim-one
rbgrouleff/bclose.vim
@ -382,7 +387,6 @@ reedes/vim-wordy
rhysd/committia.vim
rhysd/vim-grammarous
rhysd/vim-operator-surround
Rip-Rip/clang_complete
rodjek/vim-puppet
romainl/vim-cool
ron89/thesaurus_query.vim
@ -392,15 +396,11 @@ roxma/nvim-yarp
RRethy/vim-illuminate
rust-lang/rust.vim
ryanoasis/vim-devicons
Rykka/riv.vim
ryvnf/readline.vim
sakhnik/nvim-gdb
saltstack/salt-vim
samoshkin/vim-mergetool
sbdchd/neoformat
scrooloose/nerdcommenter
scrooloose/nerdtree
scrooloose/syntastic
sebastianmarkow/deoplete-rust
SevereOverfl0w/deoplete-github
sheerun/vim-polyglot
@ -502,21 +502,18 @@ uarun/vim-protobuf
udalov/kotlin-vim
ujihisa/neco-look
unblevable/quick-scope
valloric/youcompleteme
Valodim/deoplete-notmuch
vhda/verilog_systemverilog.vim
vim-airline/vim-airline
vim-airline/vim-airline-themes
vimlab/split-term.vim
vimoutliner/vimoutliner
vim-pandoc/vim-pandoc
vim-pandoc/vim-pandoc-after
vim-pandoc/vim-pandoc-syntax
vim-ruby/vim-ruby
vim-scripts/a.vim
vim-scripts/align
vim-scripts/argtextobj.vim
vim-scripts/autoload_cscope.vim
vim-scripts/a.vim
vim-scripts/bats.vim
vim-scripts/BufOnly.vim
vim-scripts/changeColorScheme.vim
@ -539,12 +536,15 @@ vim-scripts/taglist.vim
vim-scripts/utl.vim
vim-scripts/wombat256.vim
vim-scripts/YankRing.vim
vim-syntastic/syntastic
vim-utils/vim-husk
vimlab/split-term.vim
vimoutliner/vimoutliner
vimwiki/vimwiki
vito-c/jq.vim
vmchale/ats-vim
vmchale/dhall-vim
w0rp/ale
VundleVim/Vundle.vim
wakatime/vim-wakatime
wannesm/wmgraphviz.vim
wellle/targets.vim
@ -553,11 +553,11 @@ will133/vim-dirdiff
wincent/command-t
wincent/ferret
wsdjeg/vim-fetch
xavierd/clang_complete
xolox/vim-easytags
xolox/vim-misc
xuhdev/vim-latex-live-preview
ycm-core/YouCompleteMe
Yggdroot/indentLine
zah/nim.vim
zchee/deoplete-clang
zchee/deoplete-go
zig-lang/zig.vim
ziglang/zig.vim