summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorMatthieu Coudron <mcoudron@hotmail.com>2021-08-13 23:48:03 +0200
committerMatthieu Coudron <mcoudron@hotmail.com>2021-08-14 00:08:19 +0200
commit7344a0e7631f88b5c8a7362d83ca4423e36efe40 (patch)
treef6fa90d8bb4449545d3ad24f4f4c0c5f1b0aea44 /maintainers/scripts
parent196138ea6b9803a42c6720f421db023b953926d2 (diff)
downloadnixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar.gz
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar.bz2
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar.lz
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar.xz
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.tar.zst
nixpkgs-7344a0e7631f88b5c8a7362d83ca4423e36efe40.zip
update.py: fix vim's updater script
recent updates to luarocks updater had broken the vim plugin update script
Diffstat (limited to 'maintainers/scripts')
-rw-r--r--maintainers/scripts/pluginupdate.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py
index 79f5b93be8a..c468b33bb47 100644
--- a/maintainers/scripts/pluginupdate.py
+++ b/maintainers/scripts/pluginupdate.py
@@ -86,7 +86,7 @@ class PluginDesc:
     owner: str
     repo: str
     branch: str
-    alias: str
+    alias: Optional[str]
 
 
 class Repo:
@@ -317,12 +317,10 @@ def get_current_plugins(editor: Editor) -> List[Plugin]:
 
 
 def prefetch_plugin(
-    user: str,
-    repo_name: str,
-    branch: str,
-    alias: Optional[str],
+    p: PluginDesc,
     cache: "Optional[Cache]" = None,
 ) -> Tuple[Plugin, Dict[str, str]]:
+    user, repo_name, branch, alias = p.owner, p.repo, p.branch, p.alias
     log.info(f"Fetching last commit for plugin {user}/{repo_name}@{branch}")
     repo = Repo(user, repo_name, branch, alias)
     commit, date = repo.latest_commit()
@@ -347,7 +345,7 @@ def prefetch_plugin(
 
 
 def fetch_plugin_from_pluginline(plugin_line: str) -> Plugin:
-    plugin, _ = prefetch_plugin(*parse_plugin_line(plugin_line))
+    plugin, _ = prefetch_plugin(parse_plugin_line(plugin_line))
     return plugin
 
 
@@ -466,11 +464,11 @@ class Cache:
 
 
 def prefetch(
-    args: PluginDesc, cache: Cache
+    pluginDesc: PluginDesc, cache: Cache
 ) -> Tuple[str, str, Union[Exception, Plugin], dict]:
-    owner, repo = args.owner, args.repo
+    owner, repo = pluginDesc.owner, pluginDesc.repo
     try:
-        plugin, redirect = prefetch_plugin(owner, repo, args.branch, args.alias, cache)
+        plugin, redirect = prefetch_plugin(pluginDesc, cache)
         cache[plugin.commit] = plugin
         return (owner, repo, plugin, redirect)
     except Exception as e:
@@ -576,8 +574,9 @@ def update_plugins(editor: Editor, args):
         if autocommit:
             commit(
                 nixpkgs_repo,
-                "{editor.get_drv_name name}: init at {version}".format(
-                    editor=editor.name, name=plugin.normalized_name, version=plugin.version
+                "{drv_name}: init at {version}".format(
+                    drv_name=editor.get_drv_name(plugin.normalized_name),
+                    version=plugin.version
                 ),
                 [args.outfile, args.input_file],
             )