From 9e9b097770e57df9af98aae9aa09e4478a01f0bc Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 6 Feb 2007 12:14:17 +0000 Subject: [PATCH] Handles these cases: old package new package ----------- ----------- A (hash = XYZ) B (hash = XYZ) C (hash = XYZ) D (hash = XYZ) handled with relocations ( A -> B, A -> C, A -> D) old package new package ----------- ----------- B (hash = XYZ) C (hash = XYZ) D (hash = XYZ) set was again only adding one of these.. handled with not using set and adding B, C, D as they were to delta. --- pisi/delta.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pisi/delta.py b/pisi/delta.py index 9745c7f0..cc4a1b95 100644 --- a/pisi/delta.py +++ b/pisi/delta.py @@ -105,7 +105,11 @@ def find_delta(oldfiles, newfiles): files_old = set(map(lambda x:x.hash, oldfiles.list)) files_delta = files_new - files_old - return map(lambda x:hashto_files[x][0], files_delta) + deltas = [] + for hash in files_delta: + deltas.extend(hashto_files[hash]) + + return deltas def find_relocations(oldfiles, newfiles): @@ -126,6 +130,7 @@ def find_relocations(oldfiles, newfiles): if hash in files_old and files_new[hash][0].path != files_old[hash][0].path: # symlinks are not relocated, they already come with the delta package if not os.path.islink("/" + files_old[hash][0].path): - relocations.append((files_old[hash][0], files_new[hash][0])) + for i in range(len(files_new[hash])): + relocations.append((files_old[hash][0], files_new[hash][i])) return relocations