diff --git a/debian/tools/patchupdate.py b/debian/tools/patchupdate.py index 4a1cef54..2dd39df3 100755 --- a/debian/tools/patchupdate.py +++ b/debian/tools/patchupdate.py @@ -376,6 +376,7 @@ def verify_patch_order(all_patches, indices, filename): # Fast path -> we know that it applies properly if cached_patch_result.has_key(unique_hash): result_hash = cached_patch_result[unique_hash] + assert result_hash is not None else: # Now really get the file, if we don't have it yet @@ -386,19 +387,25 @@ def verify_patch_order(all_patches, indices, filename): try: content = patchutils.apply_patch(original_content, patches, fuzz=0) except patchutils.PatchApplyError: - if last_result_hash is not None: break + # Remember that we failed to apply the patches, but continue, if there is still a chance + # that it applies in a different order (to give a better error message). failed_to_apply = True - continue + if last_result_hash is None: + continue + break # Get hash of resulting file and add to cache result_hash = hashlib.sha256(content).digest() cached_patch_result[unique_hash] = result_hash + # No known hash yet, remember the result. If we failed applying before, we can stop now. if last_result_hash is None: last_result_hash = result_hash if failed_to_apply: break + + # Applied successful, but result has a different hash - also treat as failure. elif last_result_hash != result_hash: - last_result_hash = None + failed_to_apply = True break # If something failed, then show the appropriate error message. @@ -406,7 +413,7 @@ def verify_patch_order(all_patches, indices, filename): raise PatchUpdaterError("Changes to file %s don't apply on git source tree: %s" % (filename, ", ".join([all_patches[i].name for i in indices]))) - elif failed_to_apply or last_result_hash is None: + elif failed_to_apply: raise PatchUpdaterError("Depending on the order some changes to file %s dont't apply / lead to different results: %s" % (filename, ", ".join([all_patches[i].name for i in indices]))) diff --git a/patches/Makefile b/patches/Makefile index 9a8a80eb..17ebed3b 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -572,7 +572,7 @@ ntdll-Heap_FreeLists.ok: # | * dlls/kernel32/path.c, dlls/kernel32/volume.c, dlls/ntdll/file.c, dlls/ntdll/tests/file.c, include/ntifs.h # | .INTERMEDIATE: ntdll-Junction_Points.ok -ntdll-Junction_Points.ok: +ntdll-Junction_Points.ok: ntdll-Fix_Free.ok $(call APPLY_FILE,ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch) $(call APPLY_FILE,ntdll-Junction_Points/0002-ntdll-Add-support-for-reading-junction-points.patch) $(call APPLY_FILE,ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch) diff --git a/patches/ntdll-Junction_Points/definition b/patches/ntdll-Junction_Points/definition index 61925681..3e7115d0 100644 --- a/patches/ntdll-Junction_Points/definition +++ b/patches/ntdll-Junction_Points/definition @@ -1,4 +1,5 @@ Author: Erich E. Hoover Subject: Support for junction points/reparse points. Revision: 1 +Depends: ntdll-Fix_Free Fixes: [12401] Support for Junction Points