diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-02-06 23:25:51 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-02-06 23:25:51 +0000 |
commit | 3713aabaaba16cad2ecfa85cb556755ffe2d664f (patch) | |
tree | 061a75a9439ee8d87129bc420278732defcb8f6c /yarns/9000-implements.yarn | |
parent | 6b6387c357faab0153c6dd9207dfec1e3779e7fc (diff) | |
download | obnam-3713aabaaba16cad2ecfa85cb556755ffe2d664f.tar.gz |
Make exclude-caches scenario clearer, robust
Originally, we would create L/wanted, then do a manifest, then create
L/cache, then backup, restore, verify. This would sometimes fail, if
the full-second timestamp of L would change when L/cache was created.
So we (well, I) changed it so that we fiddled with the manifest just
before making a backup, but this was weird and confusing and would
still sometimes fail. This should now be much clearer and therefore
more robust.
Diffstat (limited to 'yarns/9000-implements.yarn')
-rw-r--r-- | yarns/9000-implements.yarn | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn index 2932373b..956c5d6d 100644 --- a/yarns/9000-implements.yarn +++ b/yarns/9000-implements.yarn @@ -137,6 +137,21 @@ entry. ' "$DATADIR/$MATCH_1" > "$DATADIR/new-manifest" mv "$DATADIR/new-manifest" "$DATADIR/$MATCH_1" +Sometimes we create manifests with extra stuff. This allows us to +remove them afterwards. + + IMPLEMENTS GIVEN (\S+) is removed from manifest (\S+) + awk -v skip1="$MATCH_1" -v skip2="$MATCH_1/" ' + $1 == "Name:" && + ($2 == skip1 || substr($2, 1, length(skip2)) == skip2) { + paragraph = ""; ignore = 1; next } + NF > 0 && !ignore { paragraph = paragraph $0 "\n" } + NF == 0 && paragraph { printf "%s\n", paragraph; paragraph = "" } + NF == 0 { ignore = 0 } + END { if (paragraph) printf "%s", paragraph } + ' "$DATADIR/$MATCH_2" > "$DATADIR/$MATCH_2.new" + mv "$DATADIR/$MATCH_2.new" "$DATADIR/$MATCH_2" + Obnam configuration management ------------------------------ |