lkml.org 
[lkml]   [2004]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] ketchup - support new -post releases
From
Date
Since 2.6.8.1 came out, I'm sure a lot of automated tools stopped
working, ketchup included.

I'm sure this patch isn't complete, but it does work to patch from 2.6.8
-> 2.6.8.1 or 2.6.8.1-mm*, so it is at least a start.

-- Dave
--- ketchup-0.8.orig 2004-08-16 15:42:28.000000000 -0700
+++ ketchup-0.8 2004-08-20 10:03:05.000000000 -0700
@@ -126,35 +126,42 @@
return r

def pre(ver):
- try: return re.match(r'\d+\.\d+\.\d+-((rc|pre)\d+)', ver).group(1)
+ try: return re.match(r'\d+\.\d+\.\d+(\.\d+)?-((rc|pre)\d+)', ver).group(2)
+ except: return None
+
+def post(ver):
+ try: return re.match(r'(\d+\.\d+\.\d+\.\d+)', ver).group(1)
except: return None

def pretype(ver):
- try: return re.match(r'\d+\.\d+\.\d+-((rc|pre)\d+)', ver).group(2)
+ try: return re.match(r'\d+\.\d+\.\d+(\.\d+)?-((rc|pre)\d+)', ver).group(3)
except: return None

def prenum(ver):
- try: return int(re.match(r'\d+\.\d+\.\d+-((rc|pre)(\d+))', ver).group(3))
+ try: return int(re.match(r'\d+\.\d+\.\d+-((rc|pre)(\d+))', ver).group(4))
except: return None

def prebase(ver):
- return re.match(r'(\d+\.\d+\.\d+(-(rc|pre)\d+)?)', ver).group(1)
+ return re.match(r'(\d+\.\d+\.\d+((-(rc|pre)|\.)\d+)?)', ver).group(1)

def base(ver):
- return "%s.%s" % (tree(ver), rev(ver))
+ if post(ver):
+ return prebase(ver)
+ else:
+ return "%s.%s" % (tree(ver), rev(ver))

def forkname(ver):
- try: return re.match(r'\d+.\d+.\d+(-(rc|pre)\d+)?(-(\w+?)\d+)?',
- ver).group(4)
+ try: return re.match(r'\d+.\d+.\d+(\.\d+)?(-(rc|pre)\d+)?(-(\w+?)\d+)?',
+ ver).group(5)
except: return None

def forknum(ver):
- try: return int(re.match(r'\d+.\d+.\d+(-(rc|pre)\d+)?(-(\w+?)(\d+))?',
- ver).group(5))
+ try: return int(re.match(r'\d+.\d+.\d+(\.\d+)?(-(rc|pre)\d+)?(-(\w+?)(\d+))?',
+ ver).group(6))
except: return None

def fork(ver):
- try: return re.match(r'\d+.\d+.\d+(-(rc|pre)\d+)?(-(\w+))?', ver).group(4)
+ try: return re.match(r'\d+.\d+.\d+(\.\d+)?(-(rc|pre)\d+)?(-(\w+))?', ver).group(4)
except: return None

def get_ver(makefile):
@@ -484,6 +491,11 @@
if pre(a):
apply_patch(a, 1)
a = base(a)
+ # need a loop here to apply all of the post patches
+ if post(b):
+ apply_patch(prebase(b), 0)
+ # need a loop here to back out any a post patches
+
ra, rb = rev(a), rev(b)
if ra > rb:
for r in range(ra, rb, -1):
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.060 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site