You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
patchutils.py: Invert logic for applying #ifdef patches.
This commit is contained in:
@ -338,6 +338,7 @@ def extract_patch(patchset, filename):
|
||||
for patch in patchset.patches:
|
||||
if patch.modified_file != filename:
|
||||
continue
|
||||
assert not patch.is_binary
|
||||
for chunk in patch.read_chunks():
|
||||
p.write(chunk)
|
||||
m.update(chunk)
|
||||
@ -473,8 +474,7 @@ def generate_ifdefined(all_patches, skip_checks=False):
|
||||
'subject': "Autogenerated #ifdef patch for %s." % patch.name }
|
||||
|
||||
if skip_checks:
|
||||
patch.files.append(os.path.basename(filename))
|
||||
patch.patches.append(patchutils.PatchObject(filename, headers))
|
||||
patch.files = [os.path.basename(filename)]
|
||||
continue
|
||||
|
||||
with open(filename, "wb") as fp:
|
||||
@ -527,9 +527,13 @@ def generate_ifdefined(all_patches, skip_checks=False):
|
||||
subprocess.call(["git", "add", filename])
|
||||
|
||||
# Add the autogenerated file as a last patch
|
||||
patch.files.append(os.path.basename(filename))
|
||||
patch.files = [os.path.basename(filename)]
|
||||
for p in patch.patches:
|
||||
p.filename = None
|
||||
p.modified_file = None
|
||||
for p in patchutils.read_patch(filename):
|
||||
assert p.modified_file in patch.modified_files
|
||||
p.patch_author = None
|
||||
patch.patches.append(p)
|
||||
|
||||
def generate_apply_order(all_patches, skip_checks=False):
|
||||
@ -744,6 +748,7 @@ def generate_script(all_patches, resolved):
|
||||
if len(patch.patches):
|
||||
lines.append("\t(\n")
|
||||
for p in _unique(patch.patches, key=lambda p: (p.patch_author, p.patch_subject, p.patch_revision)):
|
||||
if p.patch_author is None: continue
|
||||
lines.append("\t\techo '+ { \"%s\", \"%s\", %d },';\n" %
|
||||
(_escape(p.patch_author), _escape(p.patch_subject), p.patch_revision))
|
||||
lines.append("\t) >> \"$patchlist\"\n")
|
||||
|
Reference in New Issue
Block a user