aboutsummaryrefslogtreecommitdiff
path: root/exp/Makefile
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-30 19:29:06 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-30 19:29:06 +0200
commit875d015fc4743a457ca504ccf3ef3a9ae26d0eb3 (patch)
treefd945ca25d3a278231a675ca7497542917af53d9 /exp/Makefile
parentcda8a65123b95b1c59fd43cec8a0863b484c5deb (diff)
downloaddna-backup-875d015fc4743a457ca504ccf3ef3a9ae26d0eb3.tar.gz
dna-backup-875d015fc4743a457ca504ccf3ef3a9ae26d0eb3.zip
simplify exp by not using mktemp
Diffstat (limited to 'exp/Makefile')
-rw-r--r--exp/Makefile18
1 files changed, 12 insertions, 6 deletions
diff --git a/exp/Makefile b/exp/Makefile
index a8f9675..c2e2e3f 100644
--- a/exp/Makefile
+++ b/exp/Makefile
@@ -4,16 +4,22 @@ REPO_PATH := repo
GIT_PATH := git
GITC := git -C $(REPO_PATH)
+TEMP := temp
+
.PHONY: all
-all: versions
- @echo "total size : `awk '{s+=$$1}END{print s}' $<`"
- @echo "version count : `wc -l $<`"
+all: versions results
+ @echo "total size : `head --lines=1 results | cut -f1`"
+ @echo "version count : `wc -l versions`"
versions: results
grep [0-9]$$ $< | cut -f1 > $@
-results: commits ../dna-backup
- ./exp.sh $< $(REPO_PATH) 1| sort -k2 >$@
+results: | $(TEMP)
+ du -bad 2 $(TEMP) | sort -k2 > $@
+
+$(TEMP): commits ../dna-backup
+ rm -rf $(TEMP)
+ ./exp.sh $< $(REPO_PATH) $(TEMP)
../dna-backup: .FORCE
@$(MAKE) -C .. --no-print-directory dna-backup
@@ -30,7 +36,7 @@ repo git:
.PHONY: clean
clean:
- rm -rf $(REPO_PATH) $(GIT_PATH)
+ rm -rf $(REPO_PATH) $(GIT_PATH) $(TEMP)
rm -f commits results versions
.FORCE: ;