Allow creating and pulling static deltas starting from "empty"

You create these with something like:
  ostree static-delta generate --empty --to=master

These will be automatically used during pull if no previous revision
exists in the target repo.

These work very much like the normal static deltas except they
are named just by the "to" revision. I.e:

deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d

for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
This commit is contained in:
Alexander Larsson committed 2015-01-14 14:43:32 +01:00
1 parent 82ed6c43ed
commit 5b721a5b08
7 files changed
+78 -30

No files matched your search

+14 -2
View File
@@ -55,17 +55,23 @@ function permuteDirectory() {
done
}
origrev=$(ostree --repo=repo rev-parse test)
ostree --repo=repo static-delta generate --empty --to=${origrev}
ostree --repo=repo static-delta list | grep ${origrev} || exit 1
permuteDirectory 1 files
ostree --repo=repo commit -b test -s test --tree=dir=files
ostree --repo=repo static-delta list
origrev=$(ostree --repo=repo rev-parse test^)
newrev=$(ostree --repo=repo rev-parse test)
ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev}
ostree --repo=repo static-delta list | grep ${origrev}-${newrev} || exit 1
origstart=$(echo ${origrev} | dd bs=1 count=2 2>/dev/null)
origend=$(echo ${origrev} | dd bs=1 skip=2 2>/dev/null)
assert_has_dir repo/deltas/${origstart}/${origend}-${newrev}
assert_has_dir repo/deltas/${origstart}/${origend}
mkdir repo2
ostree --repo=repo2 init --mode=archive-z2
@@ -74,3 +80,9 @@ ostree --repo=repo2 pull-local repo ${origrev}
ostree --repo=repo2 static-delta apply-offline repo/deltas/${origstart}/${origend}-${newrev}
ostree --repo=repo2 fsck
ostree --repo=repo2 show ${newrev}
mkdir repo3
ostree --repo=repo3 init --mode=archive-z2
ostree --repo=repo3 static-delta apply-offline repo/deltas/${origstart}/${origend}
ostree --repo=repo3 fsck
ostree --repo=repo3 show ${origrev}