mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
fix to show files appearing in only one apk
This commit is contained in:
parent
4e14477faf
commit
db9c079356
1 changed files with 10 additions and 7 deletions
|
@ -74,7 +74,7 @@ def printDiff( apks, key ):
|
|||
print ''.join(diff)
|
||||
|
||||
def compare( apks, apkData, indices ):
|
||||
print 'Comparing {one} and {two}'.format(one=apks[0], two=apks[1])
|
||||
print 'Comparing', ' and '.join(apks)
|
||||
same = 0
|
||||
index = 0
|
||||
keys = list( set( apkData[0]['files'].keys() + apkData[1]['files'].keys() ) )
|
||||
|
@ -83,21 +83,24 @@ def compare( apks, apkData, indices ):
|
|||
lines = []
|
||||
sizes = set()
|
||||
crcs = set()
|
||||
inAll = True
|
||||
for apk in apkData:
|
||||
apk = apk['files']
|
||||
if key in apk:
|
||||
size = apk[key]['size']
|
||||
size = '{size: >6}b'.format(size=apk[key]['size'])
|
||||
sizes.add(size)
|
||||
crc = apk[key]['crc']
|
||||
crc = '{crc:X}'.format(crc=apk[key]['crc'])
|
||||
crcs.add( crc )
|
||||
else:
|
||||
size = 0
|
||||
lines.append( '{size: >6}b {crc:x}'.format(name=key, size=size, crc=crc) )
|
||||
if 1 == len(sizes) and 1 == len(crcs):
|
||||
size = ''
|
||||
crc = ''
|
||||
inAll = False
|
||||
lines.append( '{size: >7} {crc: >8}'.format(name=key, size=size, crc=crc) )
|
||||
if inAll and 1 == len(sizes) and 1 == len(crcs):
|
||||
same = same + 1 # same size?
|
||||
else:
|
||||
if not indices or index in indices:
|
||||
print '{index: >4}: {name: <60} '.format(index=index, name=key), ' '.join(lines)
|
||||
print '{index: >4}: {name: <60} '.format(index=index, name=key), ' '.join(lines)
|
||||
if index in indices:
|
||||
printDiff( apks, key )
|
||||
index += 1
|
||||
|
|
Loading…
Reference in a new issue