1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

gpg: fix correctly setting trust for all keys

When passing `gpg.publicKeys` a `source` including _multiple_ keys,
only the first one in `source` will have `trust` set correctly.

This commit fixes the issue and adds a corresponding test
(failing without the patch, fixed with it).
This commit is contained in:
aldur 2025-11-03 00:37:06 +00:00 committed by Austin Horstman
parent a5fee07792
commit 95d65dddae
4 changed files with 108 additions and 1 deletions

View file

@ -125,7 +125,7 @@ let
function importTrust() {
local keyIds trust
IFS='\n' read -ra keyIds <<< "$(gpgKeyId "$1")"
mapfile -t keyIds <<< "$(gpgKeyId "$1")"
trust="$2"
for id in "''${keyIds[@]}" ; do
{ echo trust; echo "$trust"; (( trust == 5 )) && echo y; echo quit; } \