From d5fb2d47307557219a5d4814aef24d8b544f1c68 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 25 Jun 2021 20:44:21 +0200 Subject: Link ~/.var/lib/gnupg to ~/.dotfiles/.secrets/gnupg; also fix GNUPG_HOME in gnupg/user-profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- gnupg/Makefile | 11 +++++++++-- gnupg/user-profile | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'gnupg') diff --git a/gnupg/Makefile b/gnupg/Makefile index f89880c..6583b2d 100644 --- a/gnupg/Makefile +++ b/gnupg/Makefile @@ -2,7 +2,14 @@ include ../common.mk install: - mkdir -p -- ~/.var/lib/gnupg + mkdir -p -- ~/.dotfiles/.secrets/gnupg + mkdir -p -- ~/.var/lib + if test -L ~/.var/lib/gnupg; then \ + test "$$(readlink -- ~/.var/lib/gnupg)" = ~/.dotfiles/.secrets/gnupg; \ + else \ + test ! -e ~/.var/lib/gnupg && \ + ln -s -- ~/.dotfiles/.secrets/gnupg ~/.var/lib/gnupg; \ + fi mkdir -p -- ~/.config/profile.d test ! -d ~/.config/profile.d/gnupg ln -sf -- ~/.dotfiles/gnupg/user-profile ~/.config/profile.d/gnupg @@ -10,6 +17,6 @@ install: uninstall: -unlink -- ~/.config/profile.d/gnupg -rmdir -- ~/.config/profile.d - -rmdir -- ~/.var/lib/gnupg + -unlink -- ~/.var/lib/gnupg .PHONY: install uninstall diff --git a/gnupg/user-profile b/gnupg/user-profile index 67cbb86..3736519 100644 --- a/gnupg/user-profile +++ b/gnupg/user-profile @@ -1,6 +1,6 @@ # -*- shell-script -*- -export GNUPGHOME=~/.var/lib/.gnupg +export GNUPGHOME=~/.var/lib/gnupg export GPG_KEY=69E7C5ED export GPG_KEYA=45668AAD -- cgit v1.2.3-70-g09d2