monotone

monotone Mtn Source Tree

Root/contrib/recreate-manifest-tables.sh

  • Property mtn:execute set to true
1#! /bin/sh
2
3: ${MTN:=mtn}
4
5for arg in "$@"; do
6 version=$("$MTN" -d "$arg" db version; echo $?)
7 case "$version" in
8 *2881277287f6ee9bfc5ee255a503a6dc20dd5994*0)
9 # this is the problem version
10 echo "$0: fixing $arg" >&2
11 "$MTN" -d "$arg" db execute '
12 CREATE TABLE manifests
13 (
14 id primary key, -- strong hash of all the entries in a manifest
15 data not null -- compressed, encoded contents of a manifest
16 )'
17
18 "$MTN" -d "$arg" db execute '
19 CREATE TABLE manifest_deltas
20 (
21 id not null, -- strong hash of all the entries in a manifest
22 base not null, -- joins with either manifest.id or manifest_deltas.id
23 delta not null, -- rdiff to construct current from base
24 unique(id, base)
25 )'
26
27 "$MTN" -d "$arg" db execute '
28 CREATE TABLE manifest_certs
29 (
30 hash not null unique, -- hash of remaining fields separated by ":"
31 id not null, -- joins with manifests.id or manifest_deltas.id
32 name not null, -- opaque string chosen by user
33 value not null, -- opaque blob
34 keypair not null, -- joins with public_keys.id
35 signature not null, -- RSA/SHA1 signature of "[name@id:val]"
36 unique(name, id, value, keypair, signature)
37 )';;
38
39 *0)
40 echo "$0: skipping $arg (not the problem version)" >&2
41 ;;
42 *)
43 # they will already have gotten an error message
44 ;;
45 esac
46done

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status