Fix problems when gpg2 is installed next to gpg (#237)

* implement fixes from https://stackoverflow.com/questions/44247308/blackbox-gpg-decrypt-fails-dont-know-ctb-00
* fix problems when working with gpg2 next to gpg. Add's readme section
* fix anchor
This commit is contained in:
Pim Snel
2018-01-05 14:05:57 +01:00
committed by Tom Limoncelli
parent 5f6e91659e
commit 0c4cdace10
2 changed files with 23 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ Table of Contents
- [Using BlackBox on Windows](#using-blackbox-on-windows) - [Using BlackBox on Windows](#using-blackbox-on-windows)
- [Using BlackBox without a repo](#using-blackbox-without-a-repo) - [Using BlackBox without a repo](#using-blackbox-without-a-repo)
- [Some Subversion gotchas](#some-subversion-gotchas) - [Some Subversion gotchas](#some-subversion-gotchas)
- [Using Blackbox when gpg2 is installed next to gpg](#using-blackbox-when-gpg2-is-installed-next-to-gpg)
- [How to submit bugs or ask questions?](#how-to-submit-bugs-or-ask-questions) - [How to submit bugs or ask questions?](#how-to-submit-bugs-or-ask-questions)
- [Developer Info](#developer-info) - [Developer Info](#developer-info)
- [Alternatives](#alternatives) - [Alternatives](#alternatives)
@@ -704,6 +705,19 @@ The current implementation will store the blackbox in `/keyrings` at the root of
This was originally written for git and supports a two-phase commit, in which `commit` is a local commit and "push" sends the change upstream to the version control server when something is registered or deregistered with the system. The current implementation will immediately `commit` a file (to the upstream subversion server) when you execute a `blackbox_*` command. This was originally written for git and supports a two-phase commit, in which `commit` is a local commit and "push" sends the change upstream to the version control server when something is registered or deregistered with the system. The current implementation will immediately `commit` a file (to the upstream subversion server) when you execute a `blackbox_*` command.
Using Blackbox when gpg2 is installed next to gpg
=================================================
In some situations, team members or automated roles need to install gpg
2.x next to the system gpg version 1.x. to catch up with the teams gpg
version. On Ubuntu 16. you can ```apt-get install gnupg2``` which
installes the binary gpg2. If you want to use this gpg2 binany run every
blackbox command with GPG=gpg2. E.g.:
```
GPG=gpg2 blackbox_postdeploy
```
How to submit bugs or ask questions? How to submit bugs or ask questions?
==================================== ====================================

View File

@@ -184,8 +184,15 @@ function prepare_keychain() {
# NB: We must export the keys to a format that can be imported. # NB: We must export the keys to a format that can be imported.
make_self_deleting_tempfile keyringasc make_self_deleting_tempfile keyringasc
export LANG="C.UTF-8" export LANG="C.UTF-8"
#if gpg2 is installed next to gpg like on ubuntu 16
if [[ "$GPG" != "gpg2" ]]; then
$GPG --export --no-default-keyring --keyring "$(get_pubring_path)" >"$keyringasc" $GPG --export --no-default-keyring --keyring "$(get_pubring_path)" >"$keyringasc"
$GPG --import "$keyringasc" 2>&1 | egrep -v 'not changed$' >&2 $GPG --import "$keyringasc" 2>&1 | egrep -v 'not changed$' >&2
else
$GPG --keyring "$(get_pubring_path)" --export | $GPG --import
fi
echo '========== Importing keychain: DONE' >&2 echo '========== Importing keychain: DONE' >&2
} }