sbt / sbt-pgp

PGP plugin for sbt
Other
144 stars 56 forks source link

"gpg: invalid option "--pinentry-mode"" when gpg is 2.0 #191

Closed eed3si9n closed 2 years ago

eed3si9n commented 3 years ago

steps

gpg --version
gpg (GnuPG) 2.0.22

problem

[info] gpg: invalid option "--pinentry-mode"
--
  | [error] java.lang.RuntimeException: Failure running 'gpg --batch --pinentry-mode loopback --passphrase *** --detach-sign --armor --use-agent --output /var/lib/buildkite-agent/builds/...'.  Exit code: 2

notes

Unfortunately the --pinentry-mode option is only available from GPG version 2.1, but isLegacyGpg just checks the major version. When the plugin is used with 2.0.x we get an invalid option error.

See here for a similar issue.

Originally posted by @aakoshh in https://github.com/sbt/sbt-pgp/issues/184#issuecomment-802931904

winitzki commented 2 years ago

To fix: https://github.com/sbt/sbt-pgp/pull/197