summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-03-18 11:28:38 -0700
committerSean Whitton <spwhitton@spwhitton.name>2016-03-18 11:28:38 -0700
commit71a5e706eea446a9157d0469c8e96c08b62f1df9 (patch)
tree180783b1b6ca4f6408997ad0aec7156d020b5cad
parent82ab89f11a4ece4582ad05c747dcf13716d7a207 (diff)
downloaddotfiles-71a5e706eea446a9157d0469c8e96c08b62f1df9.tar.gz
automatic symlink fixes for GPG
-rw-r--r--home-mrconfig19
1 files changed, 19 insertions, 0 deletions
diff --git a/home-mrconfig b/home-mrconfig
index f2d96393..d7cc5bb4 100644
--- a/home-mrconfig
+++ b/home-mrconfig
@@ -158,6 +158,21 @@ lib =
fi
fi
}
+ # For the case where the updated file overwrites the symlink (this
+ # is for ~/src/priv which is not checked out on win32 so skip that
+ # check)
+ fix_overwritten_symlink_aggressive () {
+ local file=$1
+ if [ ! -L "$HOME/$file" \
+ -a "$HOME/$file" -nt "$HOME/src/priv/$file" ]; then
+ mv "$HOME/$file" "$HOME/src/priv/$file"
+ fi
+ }
+
+# TODO: have a variable "unstowable" listing the files in a repo that
+# should be fixed by the above code, and incorporate into mr stow
+# library. Similarly set MR_NAME as a variable or something (should
+# work on that library)
# --- primary dotfiles repository
@@ -261,6 +276,10 @@ pre_update = mr autoci
# into ~/.duply, make the dirs first
pre_stow = homedir_mkdirs
+pre_unstow = fix_overwritten_symlink_aggressive .gnupg/pubring.gpg; fix_overwritten_symlink_aggressive .gnupg/secring.gpg; fix_overwritten_symlink_aggressive .gnupg/trustdb.gpg;
+pre_restow = fix_overwritten_symlink_aggressive .gnupg/pubring.gpg; fix_overwritten_symlink_aggressive .gnupg/secring.gpg; fix_overwritten_symlink_aggressive .gnupg/trustdb.gpg;
+pre_update = fix_overwritten_symlink_aggressive .gnupg/pubring.gpg; fix_overwritten_symlink_aggressive .gnupg/secring.gpg; fix_overwritten_symlink_aggressive .gnupg/trustdb.gpg;
+
[src/athpriv]
checkout = git clone athenap:athpriv athpriv
lib = MR_NAME=athpriv