patchupdate.py: Fix escaping of some special characters.

This commit is contained in:
Sebastian Lackner 2014-11-23 19:45:14 +01:00
parent 7c3d480e56
commit 0301a239d6
2 changed files with 7 additions and 7 deletions

View File

@ -78,13 +78,13 @@ def _pairs(a):
def _unique(iterable, key=None):
"List unique elements, preserving order. Remember only the element just seen."
# unique_justseen('AAAABBBCCDAABBB') --> A B C D A B
# unique_justseen('ABBCcAD', str.lower) --> A B C A D
# _unique('AAAABBBCCDAABBB') --> A B C D A B
# _unique('ABBCcAD', str.lower) --> A B C A D
return itertools.imap(next, itertools.imap(operator.itemgetter(1), itertools.groupby(iterable, key)))
def _escape(s):
"""Escape string inside of '...' quotes."""
return s.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "'\\''")
return s.replace("\\", "\\\\\\\\").replace("\"", "\\\"").replace("'", "'\\''")
def _load_dict(filename):
"""Load a Python dictionary object from a file."""

View File

@ -491,8 +491,8 @@ gdi32-MultiMonitor.ok:
$(call APPLY_FILE,gdi32-MultiMonitor/0002-winex11-Make-GetMonitorInfo-give-a-different-device-.patch)
$(call APPLY_FILE,gdi32-MultiMonitor/0003-user32-Implement-EnumDisplayDevicesW-based-on-EnumDi.patch)
@( \
echo '+ { "Ken Thomases", "gdi32: Also accept \"\\\\.\\DISPLAY<n>\" devices names with <n> other than 1 as display devices.", 1 },'; \
echo '+ { "Ken Thomases", "winex11: Make GetMonitorInfo() give a different device name (\\.\\DISPLAY<n>) to each monitor.", 1 },'; \
echo '+ { "Ken Thomases", "gdi32: Also accept \"\\\\\\\\.\\\\DISPLAY<n>\" devices names with <n> other than 1 as display devices.", 1 },'; \
echo '+ { "Ken Thomases", "winex11: Make GetMonitorInfo() give a different device name (\\\\.\\\\DISPLAY<n>) to each monitor.", 1 },'; \
echo '+ { "Ken Thomases", "user32: Implement EnumDisplayDevicesW() based on EnumDisplayMonitors() and GetMonitorInfoW().", 1 },'; \
) > gdi32-MultiMonitor.ok
@ -1540,7 +1540,7 @@ user32-WndProc.ok:
wine.inf-ProductId.ok:
$(call APPLY_FILE,wine.inf-ProductId/0001-wine.inf-Add-fake-ProductId-to-HKLM-CurrentVersionNT.patch)
@( \
echo '+ { "Yanis Lukes", "wine.inf: Add fake ProductId to HKLM\\CurrentVersionNT.", 1 },'; \
echo '+ { "Yanis Lukes", "wine.inf: Add fake ProductId to HKLM\\\\CurrentVersionNT.", 1 },'; \
) > wine.inf-ProductId.ok
# Patchset wineboot-HKEY_DYN_DATA
@ -1555,7 +1555,7 @@ wine.inf-ProductId.ok:
wineboot-HKEY_DYN_DATA.ok:
$(call APPLY_FILE,wineboot-HKEY_DYN_DATA/0001-wineboot-Add-some-generic-hardware-in-HKEY_DYN_DATA-.patch)
@( \
echo '+ { "Michael Müller", "wineboot: Add some generic hardware in HKEY_DYN_DATA\\Config Manager\\Enum.", 1 },'; \
echo '+ { "Michael Müller", "wineboot: Add some generic hardware in HKEY_DYN_DATA\\\\Config Manager\\\\Enum.", 1 },'; \
) > wineboot-HKEY_DYN_DATA.ok
# Patchset winebuild-LinkerVersion