From 204731c0a69136c9cebcb54f1afecf5145e26bbe Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 23 May 2024 13:26:22 +0200 Subject: refactor(pkgs): Categorize into `by-name` shards This might not be the perfect way to organize a package set -- especially if the set is not nearly the size of nixpkgs -- but it is _at_ least a way of organization. --- pkgs/by-name/vi/vim-plugins/update.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 pkgs/by-name/vi/vim-plugins/update.sh (limited to 'pkgs/by-name/vi/vim-plugins/update.sh') diff --git a/pkgs/by-name/vi/vim-plugins/update.sh b/pkgs/by-name/vi/vim-plugins/update.sh new file mode 100755 index 00000000..6a0d3452 --- /dev/null +++ b/pkgs/by-name/vi/vim-plugins/update.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +BASE_DIR="$(readlink -f "$(dirname "$0")/plugins")" + +# Fetch plugins +cd "$BASE_DIR" || (echo "BUG: No '$BASE_DIR'" && exit 1) + +# Cleanup manifest +sort -o "$BASE_DIR/manifest.txt" "$BASE_DIR/manifest.txt" +sort -o "$BASE_DIR/blacklist.txt" "$BASE_DIR/blacklist.txt" +## Remove all plugins, which are on the blacklist +# The same file is read and written to +# shellcheck disable=SC2005 +echo "$(comm -23 "$BASE_DIR/manifest.txt" "$BASE_DIR/blacklist.txt")" >"$BASE_DIR/manifest.txt" + +# Backup vim-plugins.nix +mv "$BASE_DIR/default.nix" "$BASE_DIR/default.nix.bak" +echo "{...} : {}" >"$BASE_DIR/default.nix" + +# Generate derivations for new plugins (this binary is provided by the dev-environment) +update-vim-plugins cleanup "$BASE_DIR" + +# Restore vim-plugins.nix +mv "$BASE_DIR/default.nix.bak" "$BASE_DIR/default.nix" + +# Update new plugins +update-vim-plugins update "$BASE_DIR" --all -- cgit 1.4.1