mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 16:36:20 +00:00
scripts/debug.py: emit the immutable-share version number, tolerate v2
This commit is contained in:
parent
c289a9c31b
commit
fd32d72b20
@ -53,10 +53,12 @@ def dump_immutable_share(options):
|
|||||||
f = storage.ShareFile(options['filename'])
|
f = storage.ShareFile(options['filename'])
|
||||||
# use a ReadBucketProxy to parse the bucket and find the uri extension
|
# use a ReadBucketProxy to parse the bucket and find the uri extension
|
||||||
bp = ReadBucketProxy(None)
|
bp = ReadBucketProxy(None)
|
||||||
offsets = bp._parse_offsets(f.read_share_data(0, 0x24))
|
offsets = bp._parse_offsets(f.read_share_data(0, 0x44))
|
||||||
|
print >>out, "%20s: %d" % ("version", bp._version)
|
||||||
seek = offsets['uri_extension']
|
seek = offsets['uri_extension']
|
||||||
length = struct.unpack(">L", f.read_share_data(seek, 4))[0]
|
length = struct.unpack(bp._fieldstruct,
|
||||||
seek += 4
|
f.read_share_data(seek, bp._fieldsize))[0]
|
||||||
|
seek += bp._fieldsize
|
||||||
UEB_data = f.read_share_data(seek, length)
|
UEB_data = f.read_share_data(seek, length)
|
||||||
|
|
||||||
unpacked = uri.unpack_extension_readable(UEB_data)
|
unpacked = uri.unpack_extension_readable(UEB_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user