aboutsummaryrefslogtreecommitdiff
path: root/exp/Makefile
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-30 17:42:43 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-30 17:42:43 +0200
commit471645d24895b8383acff8498b84dd65aab0d9c8 (patch)
tree7b9b5d7bf06a9bf7dae547b8e37682b4be4ae53a /exp/Makefile
parent9405a9fd6ced89701abbb426a9d4877fabfab657 (diff)
downloaddna-backup-471645d24895b8383acff8498b84dd65aab0d9c8.tar.gz
dna-backup-471645d24895b8383acff8498b84dd65aab0d9c8.zip
first add of exp and Makefiles
Diffstat (limited to 'exp/Makefile')
-rw-r--r--exp/Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/exp/Makefile b/exp/Makefile
new file mode 100644
index 0000000..37fa8c8
--- /dev/null
+++ b/exp/Makefile
@@ -0,0 +1,33 @@
+REPO_URL := https://club1.fr/~nicolas/git/dna-backup/
+
+REPO_PATH := repo
+GIT_PATH := git
+GITC := git -C $(REPO_PATH)
+
+BIN_PATH := ..
+
+.PHONY: apply
+apply: commits ../dna-backup
+ cat $< | while read i; do \
+ $(GITC) checkout `echo "$$i" | cut -f1`; \
+ done
+
+$(BIN_PATH)/dna-backup: .FORCE
+ $(MAKE) -C $(BIN_PATH) dna-backup
+
+commits: Makefile repo git
+ $(GITC) log --reverse --no-merges --pretty=tformat:"%H %as" \
+ | sort --unique --key=2 \
+ > $@
+
+repo git:
+ git clone --separate-git-dir=$(GIT_PATH) $(REPO_URL) $(REPO_PATH)
+# remove warning about detached head state
+ $(GITC) config advice.detachedHead false
+
+.PHONY: clean
+clean:
+ rm -rf $(REPO_PATH) $(GIT_PATH)
+ rm -f commits
+
+.FORCE: ;