[kernel] r8346 - in dists/trunk/linux-2.6/debian/patches/bugfix/all: . stable

Bastian Blank waldi at alioth.debian.org
Sat Mar 10 12:30:04 CET 2007


Author: waldi
Date: Sat Mar 10 11:30:03 2007
New Revision: 8346

Added:
   dists/trunk/linux-2.6/debian/patches/bugfix/all/
   dists/trunk/linux-2.6/debian/patches/bugfix/all/stable/
   dists/trunk/linux-2.6/debian/patches/bugfix/all/stable/gen-patch   (contents, props changed)
Log:
debian/patches/bugfix/all/stable/gen-patch: Add.


Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/stable/gen-patch
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/all/stable/gen-patch	Sat Mar 10 11:30:03 2007
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+
+import os.path, re, sys
+
+class Version(object):
+    _rules = ur"^(\d+\.\d+\.\d+)\.(\d+)$"
+    _re = re.compile(_rules)
+
+    def __init__(self, version):
+        self.complete = version
+        match = self._re.match(version)
+        if match is None:
+            raise RuntimeError
+        self.release = match.group(1)
+        self.patch = int(match.group(2))
+
+class GenPatch(object):
+    def __init__(self, path, repo, version):
+        self.path = path
+        self.repo = repo
+        self.version = version
+
+    def __call__(self):
+        patch = os.path.join(self.path, self.version.complete)
+        log = os.path.join(self.path, "%s.log" % self.version.complete)
+        print patch, log
+        if self.version.patch == 1:
+            tag_in = "v%s" % self.version.release
+        else:
+            tag_in = "v%s.%d" % (self.version.release, self.version.patch - 1)
+        tag_out = "v%s" % self.version.complete
+        print tag_in, tag_out
+
+        f = os.popen("cd %s; git diff %s %s | filterdiff -p 1 -x Makefile" % (self.repo, tag_in, tag_out))
+        out = file(patch, 'w')
+        for line in f:
+            out.write(line)
+        f.close()
+        f = os.popen("cd %s; git log --pretty=oneline -r %s..%s" % (self.repo, tag_in, tag_out))
+        out = file(log, 'w')
+        out.write("  * Add stable release %s:\n" % self.version.complete)
+        for line in f:
+            line = line.strip()
+            if not line:
+                continue
+            hash, log = line.split(' ', 1)
+            out.write("    - %s\n" % log)
+        f.close()
+
+if __name__ == '__main__':
+    path = os.path.realpath(os.path.dirname(sys.argv[0]))
+    repo = sys.argv[1]
+    for i in sys.argv[2:]:
+        GenPatch(path, repo, Version(i))()



More information about the Kernel-svn-changes mailing list