mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
patchupdate.py: Extract revision information directly from patch subject.
This commit is contained in:
parent
dc05c7f163
commit
723bc23e50
13
debian/tools/patchlist.sh
vendored
13
debian/tools/patchlist.sh
vendored
@ -1,19 +1,13 @@
|
||||
#!/bin/sh
|
||||
PATCH_DATA=$(cat);
|
||||
PATCH_LINES=$(echo "${PATCH_DATA}" | wc -l);
|
||||
PATCH_LINES=$((${PATCH_LINES}+22));
|
||||
PATCH_LINES=$((${PATCH_LINES}+23));
|
||||
|
||||
cat <<EOF
|
||||
From: FDS-Team <webmaster@fds-team.de>
|
||||
Subject: Autogenerated patch list.
|
||||
|
||||
---
|
||||
include/wine/library.h | 1 +
|
||||
libs/wine/config.c | 16 ++++++++++++++++
|
||||
libs/wine/wine.def | 1 +
|
||||
libs/wine/wine.map | 1 +
|
||||
4 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/include/wine/library.h b/include/wine/library.h
|
||||
index 242bb69..fae73fe 100644
|
||||
--- a/include/wine/library.h
|
||||
@ -27,7 +21,7 @@ index 242bb69..fae73fe 100644
|
||||
extern void wine_init_argv0_path( const char *argv0 );
|
||||
extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var );
|
||||
diff --git a/libs/wine/config.c b/libs/wine/config.c
|
||||
index a273502..d6b0067 100644
|
||||
index a273502..0a3182f 100644
|
||||
--- a/libs/wine/config.c
|
||||
+++ b/libs/wine/config.c
|
||||
@@ -478,6 +478,${PATCH_LINES} @@ const char *wine_get_version(void)
|
||||
@ -38,11 +32,12 @@ index a273502..d6b0067 100644
|
||||
+{
|
||||
+ const char *author;
|
||||
+ const char *subject;
|
||||
+ int revision;
|
||||
+}
|
||||
+wine_patch_data[] =
|
||||
+{
|
||||
${PATCH_DATA}
|
||||
+ { NULL, NULL }
|
||||
+ { NULL, NULL, 0 }
|
||||
+};
|
||||
+
|
||||
+/* return the applied non-standard patches */
|
||||
|
6
debian/tools/patchupdate.py
vendored
6
debian/tools/patchupdate.py
vendored
@ -499,9 +499,9 @@ def generate_makefile(all_patches):
|
||||
# Create *.ok file (used to generate patchlist)
|
||||
if len(patch.patches):
|
||||
fp.write("\t@( \\\n")
|
||||
for p in _unique(patch.patches, key=lambda p: (p.patch_author, p.patch_subject)):
|
||||
fp.write("\t\techo '+ { \"%s\", \"%s\" },'; \\\n" % \
|
||||
(_escape(p.patch_author), _escape(p.patch_subject)))
|
||||
for p in _unique(patch.patches, key=lambda p: (p.patch_author, p.patch_subject, p.patch_revision)):
|
||||
fp.write("\t\techo '+ { \"%s\", \"%s\", %d },'; \\\n" % \
|
||||
(_escape(p.patch_author), _escape(p.patch_subject), p.patch_revision))
|
||||
fp.write("\t) > %s.ok\n" % patch.name)
|
||||
else:
|
||||
fp.write("\ttouch %s.ok\n" % patch.name)
|
||||
|
71
debian/tools/patchutils.py
vendored
71
debian/tools/patchutils.py
vendored
@ -39,25 +39,26 @@ class PatchApplyError(RuntimeError):
|
||||
|
||||
class PatchObject(object):
|
||||
def __init__(self, filename, header):
|
||||
self.patch_author = header['author'] if header else None
|
||||
self.patch_email = header['email'] if header else None
|
||||
self.patch_subject = header['subject'] if header else None
|
||||
self.patch_author = header['author']
|
||||
self.patch_email = header['email']
|
||||
self.patch_subject = header['subject']
|
||||
self.patch_revision = header['revision'] if header.has_key('revision') else 1
|
||||
|
||||
self.extracted_patch = None
|
||||
self.unique_hash = None
|
||||
self.extracted_patch = None
|
||||
self.unique_hash = None
|
||||
|
||||
self.filename = filename
|
||||
self.offset_begin = None
|
||||
self.offset_end = None
|
||||
self.isbinary = False
|
||||
self.filename = filename
|
||||
self.offset_begin = None
|
||||
self.offset_end = None
|
||||
self.isbinary = False
|
||||
|
||||
self.oldname = None
|
||||
self.newname = None
|
||||
self.modified_file = None
|
||||
self.oldname = None
|
||||
self.newname = None
|
||||
self.modified_file = None
|
||||
|
||||
self.oldsha1 = None
|
||||
self.newsha1 = None
|
||||
self.newmode = None
|
||||
self.oldsha1 = None
|
||||
self.newsha1 = None
|
||||
self.newmode = None
|
||||
|
||||
def is_binary(self):
|
||||
return self.isbinary
|
||||
@ -287,6 +288,29 @@ def read_patch(filename):
|
||||
patch.offset_end = fp.tell()
|
||||
return patch
|
||||
|
||||
def _parse_author(author):
|
||||
author = ' '.join([data.decode(format or 'utf-8').encode('utf-8') for \
|
||||
data, format in email.header.decode_header(author)])
|
||||
r = re.match("\"?([^\"]*)\"? <(.*)>", author)
|
||||
if r is None: raise NotImplementedError("Failed to parse From - header.")
|
||||
return r.group(1).strip(), r.group(2).strip()
|
||||
|
||||
def _parse_subject(subject):
|
||||
subject = subject.strip()
|
||||
if subject.endswith("."): subject = subject[:-1]
|
||||
r = re.match("\\[PATCH([^]]*)\\](.*)", subject, re.IGNORECASE)
|
||||
if r is not None:
|
||||
subject = r.group(2).strip()
|
||||
r = re.search("v([0-9]+)", r.group(1), re.IGNORECASE)
|
||||
if r is not None: return "%s." % subject, int(r.group(1))
|
||||
r = re.match("(.*)\\((v|try|rev|take) *([0-9]+)\\)", subject, re.IGNORECASE)
|
||||
if r is not None: return "%s." % r.group(1).strip(), int(r.group(3))
|
||||
r = re.match("(.*)[.,] *(v|try|rev|take) *([0-9]+)", subject, re.IGNORECASE)
|
||||
if r is not None: return "%s." % r.group(1).strip(), int(r.group(3))
|
||||
r = re.match("([^:]+) v([0-9])+: (.*)", subject, re.IGNORECASE)
|
||||
if r is not None: return "%s: %s." % (r.group(1), r.group(3)), int(r.group(2))
|
||||
return "%s." % subject, 1
|
||||
|
||||
header = {}
|
||||
with _FileReader(filename) as fp:
|
||||
while True:
|
||||
@ -295,12 +319,7 @@ def read_patch(filename):
|
||||
break
|
||||
|
||||
elif line.startswith("From: "):
|
||||
author = ' '.join([data.decode(format or 'utf-8').encode('utf-8') for \
|
||||
data, format in email.header.decode_header(line[6:])])
|
||||
r = re.match("\"?([^\"]*)\"? <(.*)>", author)
|
||||
if r is None: raise NotImplementedError("Failed to parse From - header.")
|
||||
header['author'] = r.group(1).strip()
|
||||
header['email'] = r.group(2).strip()
|
||||
header['author'], header['email'] = _parse_author(line[6:])
|
||||
assert fp.read() == line
|
||||
|
||||
elif line.startswith("Subject: "):
|
||||
@ -311,15 +330,7 @@ def read_patch(filename):
|
||||
if not line.startswith(" "): break
|
||||
subject += line.rstrip("\r\n")
|
||||
assert fp.read() == line
|
||||
r = re.match("^\\[PATCH[^]]*\\](.*)", subject)
|
||||
if r is not None: subject = r.group(1)
|
||||
r = re.match("(.*)\\(try [0-9]+\\)$", subject)
|
||||
if r is None: r = re.match("(.*), v[0-9]+$", subject)
|
||||
if r is None: r = re.match("^[^:]+ v[0-9]+: (.*)", subject)
|
||||
if r is not None: subject = r.group(1)
|
||||
subject = subject.strip()
|
||||
if not subject.endswith("."): subject += "."
|
||||
header['subject'] = subject.strip()
|
||||
header['subject'], header['revision'] = _parse_subject(subject)
|
||||
|
||||
elif line.startswith("diff --git "):
|
||||
tmp = line.strip().split(" ")
|
||||
|
462
patches/Makefile
462
patches/Makefile
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
From 378c383c738f097fd6fa81badca0cde5c6858970 Mon Sep 17 00:00:00 2001
|
||||
From 6661529d2422f99287336b764fe7a5b61484b8ad Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 29 May 2014 23:43:45 +0200
|
||||
Subject: loader: Add commandline option --patches to show the patch list.
|
||||
@ -6,8 +6,8 @@ Subject: loader: Add commandline option --patches to show the patch list.
|
||||
---
|
||||
dlls/ntdll/misc.c | 8 ++++++++
|
||||
dlls/ntdll/ntdll.spec | 1 +
|
||||
loader/main.c | 32 +++++++++++++++++++++++++++++++-
|
||||
3 files changed, 40 insertions(+), 1 deletion(-)
|
||||
loader/main.c | 36 +++++++++++++++++++++++++++++++++++-
|
||||
3 files changed, 44 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
|
||||
index ad1b43b..1f985e7 100644
|
||||
@ -41,7 +41,7 @@ index 7e95969..f9483aa 100644
|
||||
@ cdecl wine_get_host_version(ptr ptr) NTDLL_wine_get_host_version
|
||||
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index ac67290..db9a176 100644
|
||||
index ac67290..b1df463 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -89,7 +89,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@ -54,7 +54,7 @@ index ac67290..db9a176 100644
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -106,6 +107,35 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -106,6 +107,39 @@ static void check_command_line( int argc, char *argv[] )
|
||||
printf( "%s\n", wine_get_build_id() );
|
||||
exit(0);
|
||||
}
|
||||
@ -64,6 +64,7 @@ index ac67290..db9a176 100644
|
||||
+ {
|
||||
+ const char *author;
|
||||
+ const char *subject;
|
||||
+ int revision;
|
||||
+ }
|
||||
+ *next, *cur = wine_get_patches();
|
||||
+
|
||||
@ -72,17 +73,20 @@ index ac67290..db9a176 100644
|
||||
+ next = cur + 1;
|
||||
+ while (next->author)
|
||||
+ {
|
||||
+ if (strcmp(cur->author, next->author)) break;
|
||||
+ if (strcmp( cur->author, next->author )) break;
|
||||
+ next++;
|
||||
+ }
|
||||
+
|
||||
+ printf("%s (%d):\n", cur->author, next - cur);
|
||||
+ printf( "%s (%d):\n", cur->author, next - cur );
|
||||
+ while (cur < next)
|
||||
+ {
|
||||
+ printf(" %s\n", cur->subject);
|
||||
+ printf( " %s", cur->subject );
|
||||
+ if (cur->revision != 1)
|
||||
+ printf( " [rev %d]", cur->revision );
|
||||
+ printf( "\n" );
|
||||
+ cur++;
|
||||
+ }
|
||||
+ printf("\n");
|
||||
+ printf( "\n" );
|
||||
+ }
|
||||
+
|
||||
+ exit(0);
|
||||
|
Loading…
Reference in New Issue
Block a user