summaryrefslogtreecommitdiff
path: root/archive
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-08-06 09:47:04 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-08-06 09:47:04 -0700
commitdd0f0489921444a77e4b204823c64c5703bec706 (patch)
tree88ecbc82c19bf30e0c837040341dc768c6faea10 /archive
parent9b4b802d645ed2e1a13816866d642b5b5cdffa59 (diff)
downloaddotfiles-dd0f0489921444a77e4b204823c64c5703bec706.tar.gz
lib/dionysus content now merged into other annexes
Diffstat (limited to 'archive')
-rwxr-xr-xarchive/bin/sync-for-dionysus54
1 files changed, 54 insertions, 0 deletions
diff --git a/archive/bin/sync-for-dionysus b/archive/bin/sync-for-dionysus
new file mode 100755
index 00000000..3dc366a1
--- /dev/null
+++ b/archive/bin/sync-for-dionysus
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+. "$HOME/.shenv"
+. "$HOME/src/dotfiles/lib-src/tputfs.sh"
+
+# Sync ~/lib/dionysus annex, taking account of how I access it from
+# dionysus. Obsoleted by receive.denyCurrentBranch=updateInstead,
+# once git annex >= 6.20170228 reaches athena
+
+set -e
+
+LOCAL="$HOME/lib/dionysus"
+FLASH="/media/swhitton/SPWHITTON/doc"
+
+athena_cmd () {
+ # here we rely on the fact that ssh already passes argument
+ # through `/bin/sh -c' (note use of single-quotes in this
+ # function)
+ ssh athena 'cd $HOME/'"$1"' && . $HOME/.shenv && '"$2"
+}
+
+if [ "$(hostname -f)" = "athena.silentflame.com" ]; then
+ cd "$LOCAL" && git annex add && git annex sync
+else
+ # if [ -d "$FLASH" ]; then
+ # status adding new content on nickflash
+ # cd $FLASH && git annex add && git annex sync --no-pull --no-push --message=add
+ # fi
+
+ status work around gnupg bug on athena
+ ssh athena 'rm $XDG_RUNTIME_DIR/gnupg/*' ||:
+
+ status adding and syncing on athena
+ athena_cmd lib/dionysus "git annex add"
+ athena_cmd lib/dionysus "git annex sync origin"
+
+ status running main sync from ~/lib/dionysus
+ # if [ -d "$FLASH" ]; then
+ # cd "$LOCAL" && git annex add && git annex sync --content athena nickflash
+ # else
+ cd "$LOCAL" && git annex add && git annex sync --content
+ # fi
+
+ # if [ -d "$FLASH" ]; then
+ # status ensuring that new files on nickflash checked out
+ # cd $FLASH && git annex sync
+ # status attempting to unmount nickflash
+ # kill-ssh-and-umount /media/swhitton/SPWHITTON # TODO use $FLASH
+ # fi
+
+ status ensuring that new files on athena checked out
+ # athena_cmd lib/dionysus "git annex merge"
+ athena_cmd lib/dionysus "git annex sync origin"
+fi