2008-11-05 01:03:06 +00:00
|
|
|
#!/usr/bin/env python
|
2008-02-12 02:53:36 +00:00
|
|
|
|
|
|
|
# feed this the results of 'tahoe catalog-shares' for all servers
|
|
|
|
|
2019-03-22 10:40:58 +00:00
|
|
|
|
2008-02-12 02:53:36 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
chk_encodings = {}
|
|
|
|
sdmf_encodings = {}
|
|
|
|
sdmf_versions = {}
|
|
|
|
|
|
|
|
for catalog in sys.argv[1:]:
|
|
|
|
for line in open(catalog, "r").readlines():
|
|
|
|
line = line.strip()
|
|
|
|
pieces = line.split()
|
|
|
|
if pieces[0] == "CHK":
|
|
|
|
ftype, si, kN, size, ueb_hash, expiration, filename = pieces
|
|
|
|
if si not in chk_encodings:
|
|
|
|
chk_encodings[si] = (set(), set())
|
|
|
|
chk_encodings[si][0].add( (si, kN) )
|
|
|
|
chk_encodings[si][1].add( line )
|
|
|
|
if pieces[0] == "SDMF":
|
2008-02-13 22:12:06 +00:00
|
|
|
ftype, si, kN, size, ver, expiration, filename = pieces
|
2008-02-12 02:53:36 +00:00
|
|
|
if si not in sdmf_encodings:
|
|
|
|
sdmf_encodings[si] = (set(), set())
|
|
|
|
sdmf_encodings[si][0].add( (si, kN) )
|
|
|
|
sdmf_encodings[si][1].add( line )
|
|
|
|
if si not in sdmf_versions:
|
|
|
|
sdmf_versions[si] = (set(), set())
|
|
|
|
sdmf_versions[si][0].add( ver )
|
|
|
|
sdmf_versions[si][1].add( line )
|
|
|
|
|
2014-06-23 20:54:07 +00:00
|
|
|
del si
|
2008-02-12 02:53:36 +00:00
|
|
|
chk_multiple_encodings = [(si,lines)
|
|
|
|
for si,(encodings,lines) in chk_encodings.items()
|
|
|
|
if len(encodings) > 1]
|
|
|
|
chk_multiple_encodings.sort()
|
|
|
|
sdmf_multiple_encodings = [(si,lines)
|
|
|
|
for si,(encodings,lines) in sdmf_encodings.items()
|
|
|
|
if len(encodings) > 1
|
|
|
|
]
|
|
|
|
sdmf_multiple_encodings.sort()
|
|
|
|
sdmf_multiple_versions = [(si,lines)
|
|
|
|
for si,(versions,lines) in sdmf_versions.items()
|
|
|
|
if len(versions) > 1]
|
|
|
|
sdmf_multiple_versions.sort()
|
|
|
|
|
|
|
|
if chk_multiple_encodings:
|
2019-03-22 10:40:58 +00:00
|
|
|
print()
|
|
|
|
print("CHK multiple encodings:")
|
2008-02-12 02:53:36 +00:00
|
|
|
for (si,lines) in chk_multiple_encodings:
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + si)
|
2008-02-12 02:53:36 +00:00
|
|
|
for line in sorted(lines):
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + line)
|
2008-02-12 02:53:36 +00:00
|
|
|
if sdmf_multiple_encodings:
|
2019-03-22 10:40:58 +00:00
|
|
|
print()
|
|
|
|
print("SDMF multiple encodings:")
|
2008-02-12 02:53:36 +00:00
|
|
|
for (si,lines) in sdmf_multiple_encodings:
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + si)
|
2008-02-12 02:53:36 +00:00
|
|
|
for line in sorted(lines):
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + line)
|
2008-02-12 02:53:36 +00:00
|
|
|
if sdmf_multiple_versions:
|
2019-03-22 10:40:58 +00:00
|
|
|
print()
|
|
|
|
print("SDMF multiple versions:")
|
2008-02-12 02:53:36 +00:00
|
|
|
for (si,lines) in sdmf_multiple_versions:
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + si)
|
2008-02-12 02:53:36 +00:00
|
|
|
for line in sorted(lines):
|
2019-03-22 10:40:58 +00:00
|
|
|
print(" " + line)
|