Release: 1.4.2.2
Environment
Linux mars 2.6.16-gentoo-r7 #2 Fri May 12 07:32:54 EDT 2006 i686 AMD Athlon(tm) XP 2800+ GNU/Linux
Description
when --homedir is used with --gen-key (or $GNUPGHOME is set) gpg cannot create a new keyring or keypair.
peter@mars ~ $ gpg --homedir ~/gnupg.test --gen-key
gpg (GnuPG) 1.4.2.2; Copyright (C) 2005 Free Software Foundation, Inc.
[snip...]
gpg: keyblock resource `/home/peter/gnupg.test/secring.gpg': file open error
gpg: keyblock resource `/home/peter/gnupg.test/pubring.gpg': file open error
[then after all key info entered]
This error message is reported after entropy is gathered:
+>++++++++++>.+++++.............................>+++++...............+++++^^^
gpg: no writable public keyring found: eof
Key generation failed: eof
gpg: can't create `/home/peter/gnupg.test/random_seed': No such file or directory
The directory ~/gnupg.test exists, but is not hidden.
How To Repeat
gpg --homedir [dirname] --gen-key
Fix
I had to use default directory and move existing .gnupg dir to a save area.