git.iko.soy/typeable/nixpkgs
on master help sign in
vim/update.py: make '--add' option work
commit75e1bb15fa4d877c7b22e1e629a5d6f5df24a54a authorBruno BELANYI <bruno@belanyi.fr> dateWed 23 Feb 2022, 19:12 (5 years ago) parent63f86ed
1 file changed+8−7
maintainers/scripts/pluginupdate.py+8−7
maintainers/scripts/pluginupdate.py+8−7
@@ -454,8 +454,8 @@ def prefetch_plugin(
454454 )
455455
456456
457−def fetch_plugin_from_pluginline(plugin_line: str) -> Plugin:
458− plugin, _ = prefetch_plugin(parse_plugin_line(plugin_line))
457+def fetch_plugin_from_pluginline(config: FetchConfig, plugin_line: str) -> Plugin:
458+ plugin, _ = prefetch_plugin(parse_plugin_line(config, plugin_line))
459459 return plugin
460460
461461
@@ -586,6 +586,7 @@ def prefetch(
586586
587587
588588def rewrite_input(
589+ config: FetchConfig,
589590 input_file: Path,
590591 deprecated: Path,
591592 redirects: Dict[str, str] = None,
@@ -603,8 +604,8 @@ def rewrite_input(
603604 with open(deprecated, "r") as f:
604605 deprecations = json.load(f)
605606 for old, new in redirects.items():
606− old_plugin = fetch_plugin_from_pluginline(old)
607− new_plugin = fetch_plugin_from_pluginline(new)
607+ old_plugin = fetch_plugin_from_pluginline(config, old)
608+ new_plugin = fetch_plugin_from_pluginline(config, new)
608609 if old_plugin.normalized_name != new_plugin.normalized_name:
609610 deprecations[old_plugin.normalized_name] = {
610611 "new": new_plugin.normalized_name,
@@ -640,7 +641,7 @@ def update_plugins(editor: Editor, args):
640641 update = editor.get_update(args.input_file, args.outfile, fetch_config)
641642
642643 redirects = update()
643− editor.rewrite_input(args.input_file, editor.deprecated, redirects)
644+ editor.rewrite_input(fetch_config, args.input_file, editor.deprecated, redirects)
644645
645646 autocommit = not args.no_commit
646647
@@ -659,9 +660,9 @@ def update_plugins(editor: Editor, args):
659660 )
660661
661662 for plugin_line in args.add_plugins:
662− editor.rewrite_input(args.input_file, editor.deprecated, append=(plugin_line + "\n",))
663+ editor.rewrite_input(fetch_config, args.input_file, editor.deprecated, append=(plugin_line + "\n",))
663664 update()
664− plugin = fetch_plugin_from_pluginline(plugin_line)
665+ plugin = fetch_plugin_from_pluginline(fetch_config, plugin_line)
665666 if autocommit:
666667 commit(
667668 nixpkgs_repo,