Re: [PATCH 2/5] lib-gpg: allow tests with the GPGSM prereq first
- From
Collin Funk <collin.funk1@gmail.com>
- Date
- Oct 9, 2025, 01:29 UTC
- Message-ID
- <871pncdfrw.fsf@gmail.com>
- In-Reply-To
- <CAP8UFD2VRfZuaycCdWt4kpVpRv_UhNHdzqJ2vL8uyKJusUttnA@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 11 quoted lines
>> Okay. I wonder why we even have to create the directory manually. We >> don't do it in the GPGSM prereq either, as gpgsm seems to handle this >> for us. > > Yeah, the GPGSSH prereq does `mkdir -p "$GNUPGHOME"`, but not the GPGSM prereq. > >> Doesn't `gpg --homedir ... --import` create the home directory >> in a similar way? > > I am not sure. It might depend on the gpg version. Or maybe gpgsm > does it but not gpg. I will check.
If $GNUPGHOME or --homedir is the default (usually ~/.gnupg) gets created by 'gpg' and 'gpgsm':
$ ls ~/.gnupg
ls: cannot access '/root/.gnupg': No such file or directory
$ gpgsm
gpgsm: directory '/root/.gnupg' created
gpgsm: invalid command (there is no implicit command)
$ rm -rf ~/.gnupg && gpg
gpg: directory '/root/.gnupg' created
[...]If it is not the default then it will not be created:
$ GNUPGHOME=$HOME/test gpgsm
gpgsm: keyblock resource '/root/test/pubring.kbx': No such file or directory
$ GNUPGHOME=$HOME/test gpg
gpg: keyblock resource '/root/test/pubring.kbx': No such file or directoryCollin