From b2a83e3c95be96d0f727da606e0885a8cb5622b1 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Thu, 17 Feb 2022 03:56:44 -0300 Subject: [PATCH] vim: update the updaters! update.py and its companion update-shell.nix need to know where they are, else they can't find the root default.nix of Nixpkgs. Because of this, I further added a small piece of documentation about those path-dependent pieces of code. --- pkgs/applications/editors/vim/plugins/update-shell.nix | 3 ++- pkgs/applications/editors/vim/plugins/update.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/update-shell.nix b/pkgs/applications/editors/vim/plugins/update-shell.nix index e1b727c49e04..52a9e741af21 100644 --- a/pkgs/applications/editors/vim/plugins/update-shell.nix +++ b/pkgs/applications/editors/vim/plugins/update-shell.nix @@ -1,5 +1,6 @@ -{ pkgs ? import ../../.. { } }: +{ pkgs ? import ../../../../.. { } }: +# Ideally, pkgs points to default.nix file of Nixpkgs official tree with pkgs; let pyEnv = python3.withPackages (ps: [ ps.GitPython ]); diff --git a/pkgs/applications/editors/vim/plugins/update.py b/pkgs/applications/editors/vim/plugins/update.py index 7a631c1c7dc5..ad1c38cb375f 100755 --- a/pkgs/applications/editors/vim/plugins/update.py +++ b/pkgs/applications/editors/vim/plugins/update.py @@ -13,6 +13,9 @@ # refer to: # # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md#updating-plugins-in-nixpkgs-updating-plugins-in-nixpkgs +# +# (or the equivalent file /doc/languages-frameworks/vim.section.md from Nixpkgs master tree). +# import inspect import os @@ -27,7 +30,8 @@ log.addHandler(logging.StreamHandler()) # Import plugin update library from maintainers/scripts/pluginupdate.py ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) -sys.path.insert(0, os.path.join(ROOT.parent.parent.parent, "maintainers", "scripts")) +# Ideally, ROOT.(parent^5) points to root of Nixpkgs official tree +sys.path.insert(0, os.path.join(ROOT.parent.parent.parent.parent.parent, "maintainers", "scripts")) import pluginupdate GET_PLUGINS = f"""(with import {{}};