ACCUMULO-4400 Best effort to reset gpg-agent cache Make a best effort to reset gpg-agent cache, so that the signing key will stay cached throughout the full duration of the release candidate build, when created using build.sh
Limitations: 1. This will force the password to be input at the beginning of the build.sh script, unless the user is using some persistent cache like gnome-keyring-daemon to manage one's key. 2. If the user pauses at the prompts later in the script, for a long period of time, the cache could still expire during execution, even if the cache is reset at the start of the script. 3. The build.sh script still presumes that gpg-agent is configured with a sufficiently large enough default-cache-ttl and max-cache-ttl values, so that the cache won't expire during the creation of the release candidate. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e1cd01fa Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e1cd01fa Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e1cd01fa Branch: refs/heads/master Commit: e1cd01facfc60d15004af20fcbb272d3a0dd6a07 Parents: 9bd3306 Author: Christopher Tubbs <ctubb...@apache.org> Authored: Thu Aug 11 21:12:15 2016 -0400 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Thu Aug 11 21:12:15 2016 -0400 ---------------------------------------------------------------------- assemble/build.sh | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/e1cd01fa/assemble/build.sh ---------------------------------------------------------------------- diff --git a/assemble/build.sh b/assemble/build.sh index 9bc0beb..86f73c5 100755 --- a/assemble/build.sh +++ b/assemble/build.sh @@ -42,6 +42,8 @@ currentBranch() { local b; b=$(git symbolic-ref -q HEAD) && echo "${b##refs/head cacheGPG() { # make sure gpg agent has key cached + # first clear cache, to reset timeouts (best attempt) + { hash gpg-connect-agent && gpg-connect-agent reloadagent /bye; } &>/dev/null # TODO prompt for key instead of using default? local TESTFILE; TESTFILE=$(mktemp --tmpdir "${USER}-gpgTestFile-XXXXXXXX.txt") [[ -r $TESTFILE ]] && "$gpgCommand" --sign "${TESTFILE}" && rm -f "${TESTFILE}" "${TESTFILE}.gpg"