3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #46561 from Mic92/vim-updater-fixes

vimPlugins: updater fixes
This commit is contained in:
Jörg Thalheim 2018-09-12 09:01:22 +01:00 committed by GitHub
commit 591631f417
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 100 deletions

View file

@ -334,7 +334,7 @@ self = generated // (with generated; {
}) // lib.optionalAttrs (config.allowAliases or true) (with self; {
# aliases
airline = vim-airline;
a-vim = alternative; # backwards compat, added 2018-09-10
alternative = a-vim; # backwards compat, added 2014-10-21
bats = bats-vim;
calendar = calendar-vim;
coffee-script = vim-coffee-script;
@ -343,8 +343,9 @@ self = generated // (with generated; {
solarized = vim-colors-solarized;
colors-solarized = vim-colors-solarized;
caw = caw-vim;
Colour_Sampler_Pack = colorsamplerpack;
command-t = command_T; # backwards compat, added 2018-09-10
colorsamplerpack = Colour_Sampler_Pack;
Colour_Sampler_Pack = Colour-Sampler-Pack;
command_T = command-t; # backwards compat, added 2014-10-18
commentary = vim-commentary;
committia = committia-vim;
concealedyank = concealedyank-vim;
@ -381,7 +382,7 @@ self = generated // (with generated; {
latex-live-preview = vim-latex-live-preview;
maktaba = vim-maktaba;
multiple-cursors = vim-multiple-cursors;
neco-ghc = necoGhc; # backwards compat, added 2018-09-10
necoGhc = neco-ghc; # backwards compat, added 2014-10-18
neocomplete = neocomplete-vim;
neoinclude = neoinclude-vim;
neomru = neomru-vim;
@ -426,12 +427,12 @@ self = generated // (with generated; {
vim-addon-vim2nix = vim2nix;
vimproc = vimproc-vim;
vimshell = vimshell-vim;
vim-vinegar = vinegar; # backwards compat, added 2018-09-10
vim-watchdogs = watchdogs; # backwards compat, added 2018-09-10
vinegar = vim-vinegar;
watchdogs = vim-watchdogs;
WebAPI = webapi-vim;
wombat256 = wombat256-vim; # backwards compat, added 2015-7-8
YankRing-vim = yankring;
Yankring = yankring;
yankring = YankRing-vim;
Yankring = YankRing-vim;
YouCompleteMe = youcompleteme;
xterm-color-table = xterm-color-table-vim;
zeavim = zeavim-vim;

View file

@ -2,6 +2,16 @@
{ buildVimPluginFrom2Nix, fetchFromGitHub }:
{
a-vim = buildVimPluginFrom2Nix {
name = "a-vim-2010-11-06";
src = fetchFromGitHub {
owner = "vim-scripts";
repo = "a.vim";
rev = "2cbe946206ec622d9d8cf2c99317f204c4d41885";
sha256 = "0h62v9z5bh9xmaq22pqdb3z79i84a5rknqm68mjpy7nq7s3q42fa";
};
};
ack-vim = buildVimPluginFrom2Nix {
name = "ack-vim-2018-02-27";
src = fetchFromGitHub {
@ -43,12 +53,12 @@
};
ale = buildVimPluginFrom2Nix {
name = "ale-2018-09-10";
name = "ale-2018-09-11";
src = fetchFromGitHub {
owner = "w0rp";
repo = "ale";
rev = "99e9417ef901824200040c6a2d3e84f2e0ff4b8e";
sha256 = "1y7yp1wyghhgvmylkbdi3wbvqcw026mfaajhgna53xd3fl7z3bgd";
rev = "78af99c2566ef8fed443ce253e0de9323b9e5043";
sha256 = "0c0bcr5x73fzfmsx65pc4f9j7d9m2z6wq81nyqnn81g3ws96axih";
};
};
@ -62,16 +72,6 @@
};
};
alternative = buildVimPluginFrom2Nix {
name = "alternative-2010-11-06";
src = fetchFromGitHub {
owner = "vim-scripts";
repo = "a.vim";
rev = "2cbe946206ec622d9d8cf2c99317f204c4d41885";
sha256 = "0h62v9z5bh9xmaq22pqdb3z79i84a5rknqm68mjpy7nq7s3q42fa";
};
};
argtextobj-vim = buildVimPluginFrom2Nix {
name = "argtextobj-vim-2010-10-18";
src = fetchFromGitHub {
@ -182,8 +182,8 @@
};
};
colorsamplerpack = buildVimPluginFrom2Nix {
name = "colorsamplerpack-2012-11-30";
Colour-Sampler-Pack = buildVimPluginFrom2Nix {
name = "Colour-Sampler-Pack-2012-11-30";
src = fetchFromGitHub {
owner = "vim-scripts";
repo = "Colour-Sampler-Pack";
@ -192,8 +192,8 @@
};
};
command_T = buildVimPluginFrom2Nix {
name = "command_T-2017-11-17";
command-t = buildVimPluginFrom2Nix {
name = "command-t-2017-11-17";
src = fetchFromGitHub {
owner = "wincent";
repo = "command-t";
@ -293,16 +293,6 @@
};
};
ctrlp-vim = buildVimPluginFrom2Nix {
name = "ctrlp-vim-2018-06-28";
src = fetchFromGitHub {
owner = "ctrlpvim";
repo = "ctrlp.vim";
rev = "43cc73b8e7d4ab45f17118573eb81fd45704b989";
sha256 = "16jn9n6vavwiwh6l2av2i3livan72saaz0d0v8vmznrrs2ngi1gk";
};
};
ctrlp-z = buildVimPluginFrom2Nix {
name = "ctrlp-z-2015-10-17";
src = fetchFromGitHub {
@ -313,6 +303,16 @@
};
};
ctrlp-vim = buildVimPluginFrom2Nix {
name = "ctrlp-vim-2018-06-28";
src = fetchFromGitHub {
owner = "ctrlpvim";
repo = "ctrlp.vim";
rev = "43cc73b8e7d4ab45f17118573eb81fd45704b989";
sha256 = "16jn9n6vavwiwh6l2av2i3livan72saaz0d0v8vmznrrs2ngi1gk";
};
};
denite-extra = buildVimPluginFrom2Nix {
name = "denite-extra-2018-08-13";
src = fetchFromGitHub {
@ -334,12 +334,12 @@
};
denite-nvim = buildVimPluginFrom2Nix {
name = "denite-nvim-2018-09-05";
name = "denite-nvim-2018-09-11";
src = fetchFromGitHub {
owner = "shougo";
repo = "denite.nvim";
rev = "2771c7ae323c2a24341e0f6a83b81f1a1559df0c";
sha256 = "07gmrsn815i91wzw9d326kwlph9bqcli75dzg6c8gl0r5vib2v5b";
rev = "0fdbdfb154a84bd76deb51ad5159c52779bbe110";
sha256 = "0qc6b731g66rbpcss6dss9ak5npdg52pb7v11mc07f534fksqrpj";
};
};
@ -396,16 +396,6 @@
};
};
deoplete-nvim = buildVimPluginFrom2Nix {
name = "deoplete-nvim-2018-09-02";
src = fetchFromGitHub {
owner = "shougo";
repo = "deoplete.nvim";
rev = "8c2117b966a7f05091cd49609f8ee3641f260997";
sha256 = "0pklmb89g3hqxilv0546c21yjav26frsxb5g24ma49pii8lmzgjg";
};
};
deoplete-rust = buildVimPluginFrom2Nix {
name = "deoplete-rust-2017-07-18";
src = fetchFromGitHub {
@ -426,6 +416,16 @@
};
};
deoplete-nvim = buildVimPluginFrom2Nix {
name = "deoplete-nvim-2018-09-02";
src = fetchFromGitHub {
owner = "shougo";
repo = "deoplete.nvim";
rev = "8c2117b966a7f05091cd49609f8ee3641f260997";
sha256 = "0pklmb89g3hqxilv0546c21yjav26frsxb5g24ma49pii8lmzgjg";
};
};
dhall-vim = buildVimPluginFrom2Nix {
name = "dhall-vim-2018-07-30";
src = fetchFromGitHub {
@ -529,12 +529,12 @@
};
fzf-vim = buildVimPluginFrom2Nix {
name = "fzf-vim-2018-09-07";
name = "fzf-vim-2018-09-12";
src = fetchFromGitHub {
owner = "junegunn";
repo = "fzf.vim";
rev = "8fa84e0fdf97842d94caee8d50584836edf5b509";
sha256 = "0di5xmd3i9m034npr6zc1f793jcj1vsy95wdyhpf55b6hclm7bbd";
rev = "c3954d294a0f6c4fb5a46a1839cd42ec26767dea";
sha256 = "0pipa7vgx4vkaysyf195yphggxj5kki66yksfvdvw6yxiicap1ml";
};
};
@ -778,6 +778,16 @@
};
};
neco-ghc = buildVimPluginFrom2Nix {
name = "neco-ghc-2018-05-13";
src = fetchFromGitHub {
owner = "eagletmt";
repo = "neco-ghc";
rev = "682869aca5dd0bde71a09ba952acb59c543adf7d";
sha256 = "1v7ibi4fp99s4lswz3v0gf4i0h5i5gpj05xpsf4cixwj2zgh206h";
};
};
neco-look = buildVimPluginFrom2Nix {
name = "neco-look-2018-01-21";
src = fetchFromGitHub {
@ -808,16 +818,6 @@
};
};
necoGhc = buildVimPluginFrom2Nix {
name = "necoGhc-2018-05-13";
src = fetchFromGitHub {
owner = "eagletmt";
repo = "neco-ghc";
rev = "682869aca5dd0bde71a09ba952acb59c543adf7d";
sha256 = "1v7ibi4fp99s4lswz3v0gf4i0h5i5gpj05xpsf4cixwj2zgh206h";
};
};
neocomplete-vim = buildVimPluginFrom2Nix {
name = "neocomplete-vim-2018-03-28";
src = fetchFromGitHub {
@ -849,12 +849,12 @@
};
neomake = buildVimPluginFrom2Nix {
name = "neomake-2018-09-09";
name = "neomake-2018-09-11";
src = fetchFromGitHub {
owner = "benekastah";
repo = "neomake";
rev = "11c6797b258dfe1c0b4ee8536f2bb961003a3f76";
sha256 = "0lsrz6m29ghhz57m1ay2v26i0838czhmm6a06yfy39dy99sa02il";
rev = "f5d411eb9598b0e82187431a49598f3dce1f9484";
sha256 = "1v2ggn8bm0mp6bjyiqf9ria8jmqs4risqdwhcbj77l95ka3znx9z";
};
};
@ -913,8 +913,8 @@
src = fetchFromGitHub {
owner = "scrooloose";
repo = "nerdtree";
rev = "15d06b676dfcd92ac9a0bc375668d127f9822539";
sha256 = "1v1w4yg6mgmz0q00in0y46wcmcgh6gxx8szws5cmvwv43d5c18qs";
rev = "b3804dcd71471505048c8a75f301539fc2dce081";
sha256 = "0waa6hw9jqxy1jxcm0bx53n0cpindin9jdd5s6jh7310psqpwi1x";
};
};
@ -1969,12 +1969,12 @@
};
vim-ghost = buildVimPluginFrom2Nix {
name = "vim-ghost-2018-08-23";
name = "vim-ghost-2018-09-12";
src = fetchFromGitHub {
owner = "raghur";
repo = "vim-ghost";
rev = "666a76c0783270eeb1ac1e0027df6f801a067bfd";
sha256 = "1c5jyipcj4hi703dcdim1123p2yp4h67ci4f9kgaz9h65lmz4xn5";
rev = "4e06bc238d23e6eb245a766105c62344a132b3f4";
sha256 = "1n5m7xbv4i0bwdqm39n9j6brbjayk4cpq38sqqbvgh3lia7nkbpv";
};
};
@ -2019,12 +2019,12 @@
};
vim-go = buildVimPluginFrom2Nix {
name = "vim-go-2018-09-10";
name = "vim-go-2018-09-11";
src = fetchFromGitHub {
owner = "fatih";
repo = "vim-go";
rev = "5b9058e1232786c682be79b8a00510d3bd63eba9";
sha256 = "14jcjdq48cnpdvp6k2lanr1chvkgky7xnz8zbcqhw2ma27zy16jf";
rev = "925447051422b471490a85bcb196a27c4625b225";
sha256 = "0g41i22hr0iq1mpbv0cpzc9h6mwhncn3jv6ydhvbpvjpg8yd3wxg";
};
};
@ -2720,12 +2720,12 @@
};
vim-snippets = buildVimPluginFrom2Nix {
name = "vim-snippets-2018-09-03";
name = "vim-snippets-2018-09-11";
src = fetchFromGitHub {
owner = "honza";
repo = "vim-snippets";
rev = "1a08e283d48b4a1ada1fbcc7c363ee040aeec0c9";
sha256 = "0ska56i77dd2n2c428c9hsl2zskyag41xfsl5dg00dyjv4amvnin";
rev = "225647b65522b7421a22f138b9b0a10833d39551";
sha256 = "1ngdv1rsaa0w742k4bb942x0pd7pmjh7nghkiiv1hl8cryrwhix5";
};
};
@ -2909,6 +2909,16 @@
};
};
vim-vinegar = buildVimPluginFrom2Nix {
name = "vim-vinegar-2018-08-06";
src = fetchFromGitHub {
owner = "tpope";
repo = "vim-vinegar";
rev = "c38ea2195a43747aedf0bb4b7eb5aa8870260296";
sha256 = "1bcpi4m7ng9jaipf8xjf74469lgk34bs5ajjpv9dnkcrsalm28nf";
};
};
vim-visualstar = buildVimPluginFrom2Nix {
name = "vim-visualstar-2015-08-27";
src = fetchFromGitHub {
@ -2929,6 +2939,16 @@
};
};
vim-watchdogs = buildVimPluginFrom2Nix {
name = "vim-watchdogs-2017-12-03";
src = fetchFromGitHub {
owner = "osyo-manga";
repo = "vim-watchdogs";
rev = "a6415c2d928af8c1aacdbce9b1ed8d315891eb03";
sha256 = "0n6aqsgn0q1qgpj4yznqwbsbbk2a077gnjlq86ii3jhkzh5fzcff";
};
};
vim-wordy = buildVimPluginFrom2Nix {
name = "vim-wordy-2018-03-10";
src = fetchFromGitHub {
@ -3039,16 +3059,6 @@
};
};
vinegar = buildVimPluginFrom2Nix {
name = "vinegar-2018-08-06";
src = fetchFromGitHub {
owner = "tpope";
repo = "vim-vinegar";
rev = "c38ea2195a43747aedf0bb4b7eb5aa8870260296";
sha256 = "1bcpi4m7ng9jaipf8xjf74469lgk34bs5ajjpv9dnkcrsalm28nf";
};
};
vundle = buildVimPluginFrom2Nix {
name = "vundle-2018-02-03";
src = fetchFromGitHub {
@ -3059,16 +3069,6 @@
};
};
watchdogs = buildVimPluginFrom2Nix {
name = "watchdogs-2017-12-03";
src = fetchFromGitHub {
owner = "osyo-manga";
repo = "vim-watchdogs";
rev = "a6415c2d928af8c1aacdbce9b1ed8d315891eb03";
sha256 = "0n6aqsgn0q1qgpj4yznqwbsbbk2a077gnjlq86ii3jhkzh5fzcff";
};
};
webapi-vim = buildVimPluginFrom2Nix {
name = "webapi-vim-2018-03-14";
src = fetchFromGitHub {
@ -3109,8 +3109,8 @@
};
};
yankring = buildVimPluginFrom2Nix {
name = "yankring-2015-07-29";
YankRing-vim = buildVimPluginFrom2Nix {
name = "YankRing-vim-2015-07-29";
src = fetchFromGitHub {
owner = "vim-scripts";
repo = "YankRing.vim";

View file

@ -20,8 +20,9 @@ import xml.etree.ElementTree as ET
from datetime import datetime
from multiprocessing.dummy import Pool
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from typing import Dict, List, Optional, Tuple, Union, Any
from urllib.parse import urljoin, urlparse
from tempfile import NamedTemporaryFile
ATOM_ENTRY = "{http://www.w3.org/2005/Atom}entry"
ATOM_LINK = "{http://www.w3.org/2005/Atom}link"
@ -110,7 +111,7 @@ class Plugin:
return copy
GET_PLUGINS = """(with import <nixpkgs> {};
GET_PLUGINS = """(with import <localpkgs> {};
let
hasChecksum = value: lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value;
getChecksum = name: value:
@ -123,8 +124,24 @@ let
in lib.filterAttrs (n: v: v != null) checksums)"""
class CleanEnvironment(object):
def __enter__(self) -> None:
self.old_environ = os.environ.copy()
local_pkgs = str(ROOT.joinpath("../../.."))
os.environ["NIX_PATH"] = f"localpkgs={local_pkgs}"
self.empty_config = NamedTemporaryFile()
self.empty_config.write(b"{}")
self.empty_config.flush()
os.environ["NIXPKGS_CONFIG"] = self.empty_config.name
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
os.environ.update(self.old_environ)
self.empty_config.close()
def get_current_plugins() -> List[Plugin]:
out = subprocess.check_output(["nix", "eval", "--json", GET_PLUGINS])
with CleanEnvironment():
out = subprocess.check_output(["nix", "eval", "--json", GET_PLUGINS])
data = json.loads(out)
plugins = []
for name, attr in data.items():
@ -139,6 +156,7 @@ def prefetch_plugin(user: str, repo_name: str, cache: "Cache") -> Plugin:
has_submodules = repo.has_submodules()
cached_plugin = cache[commit]
if cached_plugin is not None:
cached_plugin.name = repo_name
cached_plugin.date = date
return cached_plugin