tnajdek / rafiki

1 stars 3 forks source link

Extract raf files in right order #1

Closed zzh8829 closed 9 years ago

zzh8829 commented 10 years ago

when extracting all files, raf.py #148:

for item,raf in self.index.iteritems():

will follow python dict order which is not correct order so sometimes old files will overwrite new files

dict order : hash of string .. seems pretty random right order : 0.0.0.old -> 0.0.0.new

solution :

sortlist = [(key,value) for key,value in self.index.iteritems() ]
sortlist.sort(key = lambda i:(len(i[0]),i[0]))
for item,raf in sortlist:
tnajdek commented 9 years ago

Hey there,

Not sure if order is important there or why would files be overriden? Also things have changed a bit since this issue been raised, could you confirm if this is still relevant?

zzh8829 commented 9 years ago

order is definitely relevant, when two package contains same file, old one could potentially override the new one. This happens all the time because instead of repackage old files, riot simply make a new package to override them.