commit 3a24d9ff195f08c2ff04f40dfa8fdd9493dadae4 parent cc6df0c4c1aaae83eb8df2c0c314443a9fdd75ce Author: Jan Pobříslo <ccx@te2000.cz> Date: Thu, 23 Jun 2022 03:01:22 +0200 Rework version stripping Diffstat:
M | zsh-functions/confz_containers_init | | | 11 | +++++------ |
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/zsh-functions/confz_containers_init b/zsh-functions/confz_containers_init @@ -1076,16 +1076,15 @@ confz_container_nix_packages_installed_check() { [[ -f $manifest_file ]] || \ die "Could not find manifest.nix file: ${(qqq)manifest_file}" - local -a world=( "${(@f)$( + local -a world world_noversion missing + world=( "${(@f)$( grep -o 'outPath = "[^"]*"' $manifest_file \ | uniq | sed 's|^outPath = "/nix/store/[^-]*-||;s|"$||' )}" ) - local -a world_noversion=( - "${${world[@]%-bin}/%-[0-9.]#/}" - ) - local -a missing - local pkg + world_noversion=( "${world[@]%-bin}" ) + world_noversion=( "${world_noversion[@]/%-[0-9.]#/}" ) + local pkg for pkg in $=vars[packages]; do (( $world[(I)${pkg}] )) || \ (( $world_noversion[(I)${pkg}] )) || \