aboutsummaryrefslogtreecommitdiff
path: root/exp
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-10-12 17:19:09 +0200
committern-peugnet <n.peugnet@free.fr>2021-10-12 17:19:43 +0200
commit52833e6a4f06da56d2adeea000c9db9b2510d3a4 (patch)
tree4afc2d509f6c8619b7b1d08398484a5fa4b7ca9b /exp
parenta8b7c983749336fbec428b0b4f44d1f0f7a31470 (diff)
downloaddna-backup-52833e6a4f06da56d2adeea000c9db9b2510d3a4.tar.gz
dna-backup-52833e6a4f06da56d2adeea000c9db9b2510d3a4.zip
Ajout de targz aux comparaisons
Diffstat (limited to 'exp')
-rw-r--r--exp/Makefile17
-rwxr-xr-xexp/exp.sh5
2 files changed, 17 insertions, 5 deletions
diff --git a/exp/Makefile b/exp/Makefile
index a5eee91..8b7ce5c 100644
--- a/exp/Makefile
+++ b/exp/Makefile
@@ -13,6 +13,7 @@ DNA_4K ?= dna_4k
DNA_8K ?= dna_8k
NOPACK ?= nopack
export GIT_NOPACK ?= $(abspath $(NOPACK))
+export TARGZ ?= targz
export REAL ?= real
export DIFFS ?= diffs
@@ -25,21 +26,21 @@ GITC := git -C $(REPO_PATH)
SKIP_COMMITS ?= 30
DNADIRS := $(DNA_4K) $(DNA_8K)
-DATADIRS := $(DNA_4K) $(DNA_8K) $(DIFFS) $(NOPACK) $(REAL)
+DATADIRS := $(DNA_4K) $(DNA_8K) $(DIFFS) $(NOPACK) $(TARGZ) $(REAL)
SIZEFILES := $(DATADIRS:%=%.size)
.PHONY: all exp
all exp: summary.csv $(SIZEFILES)
@echo "=============== SUMMARY ==============="
@head -n 1 $< | while IFS="," read -r $(DATADIRS); do \
- printf "$(DATADIRS:%=\%14s)\n" $(DATADIRS:%=$$%); \
+ printf "$(DATADIRS:%=\%13s)\n" $(DATADIRS:%=$$%); \
done
@tail -n +2 $< | while IFS="," read -r $(DATADIRS); do \
- printf "$(DATADIRS:%=\%'14d)\n" $(DATADIRS:%=$$%); \
+ printf "$(DATADIRS:%=\%'13d)\n" $(DATADIRS:%=$$%); \
done
@echo "================ TOTAL ================"
@for i in $(SIZEFILES); do cat $$i | paste -sd+ | bc; done | while read j; do \
- printf "%'14d " $$j; \
+ printf "%'13d " $$j; \
done
@echo
@@ -83,11 +84,17 @@ $(NOPACK).size: $(NOPACK).versions run
| sort -k2 \
> $@
-run: $(COMMITS) $(DNA_BACKUP) $(DNA_PARAMS) | $(DATADIRS) $(NOPACK).versions $(REAL).versions
+run: $(COMMITS) $(DNA_BACKUP) $(DNA_PARAMS) | printvars $(DATADIRS) $(NOPACK).versions $(REAL).versions
rm -rf $(DATADIRS:%=%/*) $(DATADIRS:%=%.versions/*)
./exp.sh
touch $@
+.PHONY: printvars
+printvars:
+ @$(foreach V,$(sort $(.VARIABLES)),\
+ $(if $(filter-out environment% default automatic,$(origin $V)),\
+ $(info $V=$($V))))
+
$(DNA_PARAMS):
echo "$(DNA_4K) -c 4096" >> $@
echo "$(DNA_8K) -c 8192" >> $@
diff --git a/exp/exp.sh b/exp/exp.sh
index 02cea84..113d154 100755
--- a/exp/exp.sh
+++ b/exp/exp.sh
@@ -7,6 +7,7 @@
# - GIT_PATH: the path of the repo git-dir
# - MAX_VERSION: the max number for versions for the experiment
# - COMMITS: the name of the file that contains the lists of versions
+# - TARGZ: the path of the tar.gz dir
# - DIFFS: the path of the git diff dir
# - REAL: the path of the real size dir
# - GIT_NOPACK: the path of the git nopack dir
@@ -47,6 +48,10 @@ do
log "save real size for this version"
du -b --summarize $REPO_PATH > $(printf "%s.versions/%05d" $REAL $i)
+ # Create tar.gz for this version
+ log "create targ.gz for this version"
+ tar -czf $(printf "%s/%05d.tar.gz" $TARGZ $i) $REPO_PATH
+
# Create git diff for this version
log "create git diff for this version"
diff=$(printf "%s/%05d.diff.gz" $DIFFS $i)