I am trying to connect a bunch of gpg --keyserver attempts with or in order to try several servers, but this is being foiled by the fact that gpg v2.2.12 seems to erroneously return exit code 0 (success) when it fails to import a key:
$ gpg --version
gpg (GnuPG) 2.2.12
...
$ gpg --keyserver hkps://keys.openpgp.org --recv-keys "SOME_KEY"
gpg: key SOME_KEY: new key but contains no user ID - skipped
gpg: Total number processed: 1
gpg: w/o user IDs: 1
$ echo $?
0It seems incorrect that this would have an exit code of 0, and gpg v2.2.4 seems to agree with me:
$ gpg --version
gpg (GnuPG) 2.2.4
...
$ gpg --keyserver hkps://keys.openpgp.org --recv-keys "SOME_KEY"
gpg: key SOME_KEY: no user ID
gpg: Total number processed: 1
$ echo $?
2If you're curious why I am referring to 2 gpg's, one is on my main system (Ubuntu), the other is what happens in the container I am using (debian, from the base image of buildpack-deps:buster). Both systems believe these respective versions to be the latest. I would prefer the latter behavior to the former, is there any way to have gpg 2.2.12 behave that way?
Reset to default