honor custom settings for GNUPGHOME

fix #371
This commit is contained in:
Jaromil 2020-11-13 23:16:05 +01:00
parent 9ddfdc426f
commit 136ba6e053

7
tomb
View File

@ -1934,9 +1934,10 @@ forge_key() {
_check_swap # Ensure the available memory is safe to use _check_swap # Ensure the available memory is safe to use
# Ensure GnuPG won't exit with an error before first run # Ensure GnuPG won't exit with an error before first run
[[ -r $HOME/.gnupg/pubring.gpg ]] || { local gpghome=${GNUPGHOME:-$HOME/.gnupg}
mkdir -m 0700 $HOME/.gnupg [[ -r $gpghome/pubring.gpg ]] || {
touch $HOME/.gnupg/pubring.gpg } mkdir -p -m 0700 $gpghome
touch $gpghome/pubring.gpg }
# Do not overwrite any files accidentally # Do not overwrite any files accidentally
[[ -r "$destkey" ]] && { [[ -r "$destkey" ]] && {