X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=lbs-util;h=8789a758f1ccc6941ea602bd14301a2c60e29765;hb=020917702127ad12881c8868bb649a685c561def;hp=5c124386c72b2ecf24c511aa34debb33e79c6a94;hpb=dbc502263438b4ba798f74a372c2a79fdc3061f4;p=cumulus.git diff --git a/lbs-util b/lbs-util index 5c12438..8789a75 100755 --- a/lbs-util +++ b/lbs-util @@ -6,9 +6,9 @@ import getpass, os, stat, sys, time from optparse import OptionParser import lbs -# We support up to "LBS Snapshot v0.2" formats, but are also limited by the lbs +# We support up to "LBS Snapshot v0.6" formats, but are also limited by the lbs # module. -FORMAT_VERSION = min(lbs.FORMAT_VERSION, (0, 2)) +FORMAT_VERSION = min(lbs.FORMAT_VERSION, (0, 6)) def check_version(format): ver = lbs.parse_metadata_version(format) @@ -138,7 +138,7 @@ def cmd_verify_snapshots(snapshots): print "## Root:", d['Root'] metadata = lbs.iterate_metadata(store, d['Root']) for m in metadata: - if m.fields['type'] != '-': continue + if m.fields['type'] not in ('-', 'f'): continue print "%s [%d bytes]" % (m.fields['name'], int(m.fields['size'])) verifier = lbs.ChecksumVerifier(m.fields['checksum']) size = 0 @@ -181,7 +181,7 @@ def cmd_restore_snapshot(args): if not os.path.isdir(path): os.makedirs(path) - if m.items.type == '-': + if m.items.type in ('-', 'f'): file = open(destpath, 'wb') verifier = lbs.ChecksumVerifier(m.items.checksum) size = 0 @@ -199,7 +199,12 @@ def cmd_restore_snapshot(args): if filename != '.': os.mkdir(destpath) elif m.items.type == 'l': - os.symlink(m.items.contents, destpath) + try: + target = m.items.target + except: + # Old (v0.2 format) name for 'target' + target = m.items.contents + os.symlink(target, destpath) elif m.items.type == 'p': os.mkfifo(destpath) elif m.items.type in ('c', 'b'):