Re: ketchup was Re: [kernel.org users] XZ Migration discussion

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pavel Machek
Date: Monday, February 22, 2010 - 11:59 am

On Sun 2010-02-21 14:53:41, Pavel Machek wrote:

This should work; save time&bandwidth by using incremental patches
between -rcX.

Is there testsuite for ketchup? It would be useful at this point...

   	 	       		   	    	      	   Pavel

--- ketchup.orig	2010-02-16 16:36:51.000000000 +0100
+++ ketchup	2010-02-22 19:53:56.000000000 +0100
@@ -107,19 +107,32 @@
 # Functions to parse version strings
 
 def tree(ver):
+    """returns 2.6"""
     return float(re.match(r'(\d+\.\d+)', ver).group(1))
 
+def rawrev(ver):
+    """given 2.6.31 or 2.6.31-rc1 returns 31"""
+    return int(re.match(r'\d+\.\d+\.(\d+)', ver).group(1))
+
 def rev(ver):
+    """given 2.6.31 or 2.6.32-rc1 returns 31"""
     p = pre(ver)
-    r = int(re.match(r'\d+\.\d+\.(\d+)', ver).group(1))
+    r = rawrev(ver)
     if p: r = r - 1
     return r
 
 def pre(ver):
+    """returns rc5"""
     try: return re.match(r'\d+\.\d+\.\d+(\.\d+)?-((rc|pre)\d+)', ver).group(2)
     except: return None
 
+def next_pre(ver, inc = 1):
+    s = pre(ver)
+    i = int(re.match(r'rc(\d+)', s).group(1))
+    return "rc%d" % (i+inc)
+
 def post(ver):
+    """given 2.6.27.1 returns 1"""
     try: return re.match(r'\d+\.\d+\.\d+\.(\d+)', ver).group(1)
     except: return None
 
@@ -132,9 +145,15 @@
     except: return None
 
 def prebase(ver):
+    """returns 2.6.13-rc1"""
     return re.match(r'(\d+\.\d+\.\d+((-(rc|pre)|\.)\d+)?)', ver).group(1)
 
+def preincr(ver):
+    """only use when incremental patches are requested"""
+    return re.match(r'(\d+\.\d+\.\d+((-(rc|pre)|\.).+)?)', ver).group(1)
+
 def revbase(ver):
+    """returns 2.6.23 for 2.6.23.15 or 2.6.24-rc5"""
     return "%s.%s" % (tree(ver), rev(ver))
 
 def base(ver):
@@ -283,8 +302,12 @@
     f = forkname(ver)
     p = pre(ver)
 
+    print "find_info (ver) ", ver, "f=", f
+
     s = b
-    if f:
+    if re.match(".*rc.*rc.*", ver):
+        s = "%s-incrc" %b
+    elif f:
         s = "%s-%s" % (b, f)
     elif p:
         s = "%s-pre" % b
@@ -297,11 +320,14 @@
     if type(i) != type([]):
         i = [i]
 
+    print "version urls i = ", i    
+
     v = {
         'full': ver,
         'tree': tree(ver),
         'base': base(ver),
-        'prebase': prebase(ver)
+        'prebase': prebase(ver),
+        'preincr': preincr(ver),
         }
 
     l = []
@@ -399,6 +425,7 @@
 def apply_patch(ver, reverse = 0):
     """Find the patch to upgrade from the predecessor of ver to ver and
     apply or reverse it."""
+    print 'apply patch ', ver, ' reverse = ', reverse
     p = get_patch(ver)
     r = ""
     if reverse:
@@ -501,6 +528,24 @@
     else:
         return ver
 
+def step_rc(a, b):
+    rc1base = "%s.%s" % (tree(b), rawrev(b))    
+    print 'stepping from ', a, ' to ', b 
+    while pre(a) != pre(b):
+        if pre(a) < pre(b):
+            next = next_pre(a, 1)
+            s = ("%s-%s-%s" % (rc1base, pre(a), next))
+            apply_patch(s)
+        else:
+            next = next_pre(a, -1)
+            s = ("%s-%s-%s" % (rc1base, next, pre(a)))
+            apply_patch(s, 1)
+
+        print "Applying ", s
+
+        a = "%s-%s" % (rc1base, next)
+        print "Should be at ", a
+
 def transform(a, b):
     if a == b:
         qprint("Nothing to do!")
@@ -514,10 +559,25 @@
     if fork(a):
         apply_patch(a, 1)
         a = prebase(a)
+
+    if base(a) == base(b):
+        if pre(a) and pre(b):
+            print a, ' to ', b, ' possible small steps'
+            step_rc(prebase(a), prebase(b))
+            a = prebase(b)
+
     if prebase(a) != prebase(b):
-        if pre(a):
-            apply_patch(a, 1)
-            a = base(a)
+        print 'prebase ', a, ' is not prebase ', b
+        if (rev(a) != rev(b)) and pre(a):
+            print 'stepping to release, first'
+            rc1base = "%s.%s" % (tree(a), rawrev(a))
+            rc1 = rc1base + '-rc1'
+            print "Base is ", rc1base, "now at ", a, " should go to ", rc1
+            step_rc(a, rc1)
+            print "Should now be on -rc1"
+            apply_patch(rc1, 1)
+            a = base(rc1)
+            print "Should now be at", a
 
         if post(a) and (post(a) != post(b) or rev(a) != rev(b)):
             apply_patch(prebase(a), 1)
@@ -536,9 +596,12 @@
             a = base(b)
 
         if pre(b):
-            apply_patch(prebase(b))
-            a = prebase(b)
-
+            rc1base = "%s.%s" % (tree(b), rawrev(b))
+            rc1 = rc1base + '-rc1'
+            print "Base is ", rc1base, "now at ", a, " should go to ", b
+            apply_patch(rc1)
+            step_rc(rc1, b)
+            
     if fork(b):
         a = apply_patch(b)
 
@@ -573,6 +636,10 @@
             kernel_url + "/v2.6" + "/patch-%(prebase)s.bz2",
             r'patch-(.*?).bz2',
             1, "current stable kernel series"),
+    '2.6-incrc': (latest_dir,
+                kernel_url + "/v2.6" + "/testing/incr/patch-%(preincr)s.bz2",
+                r'patch-(.*?).bz2',
+                1, "current stable kernel series prereleases -- incremental"),
     '2.6-rc': (latest_dir,
                 kernel_url + "/v2.6" + "/testing/patch-%(prebase)s.bz2",
                 r'patch-(.*?).bz2',




-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
XZ Migration discussion, J.H., (Thu Feb 11, 11:36 am)
Re: XZ Migration discussion, david, (Thu Feb 11, 12:44 pm)
Re: XZ Migration discussion, H. Peter Anvin, (Thu Feb 11, 12:48 pm)
Re: [kernel.org users] XZ Migration discussion, Willy Tarreau, (Thu Feb 11, 1:22 pm)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Thu Feb 11, 1:51 pm)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Thu Feb 11, 3:22 pm)
Re: [kernel.org mirrors] XZ Migration discussion, Carlos Carvalho, (Thu Feb 11, 5:14 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 7:01 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 7:35 am)
Re: [kernel.org users] XZ Migration discussion, Linus Torvalds, (Fri Feb 12, 8:21 am)
Re: [kernel.org users] XZ Migration discussion, Steven Rostedt, (Fri Feb 12, 8:25 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 9:11 am)
Re: [kernel.org users] XZ Migration discussion, Steven Rostedt, (Fri Feb 12, 9:30 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 9:44 am)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Fri Feb 12, 12:02 pm)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Fri Feb 12, 12:03 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 12:23 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 12:32 pm)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Fri Feb 12, 12:57 pm)
Re: [kernel.org users] XZ Migration discussion, Matthew Wilcox, (Fri Feb 12, 1:25 pm)
Re: [kernel.org users] XZ Migration discussion, Junio C Hamano, (Fri Feb 12, 1:34 pm)
Re: [kernel.org users] XZ Migration discussion, Steven Rostedt, (Fri Feb 12, 2:16 pm)
Re: [kernel.org users] XZ Migration discussion, Greg KH, (Fri Feb 12, 2:54 pm)
Re: [kernel.org users] XZ Migration discussion, Steven Rostedt, (Fri Feb 12, 2:58 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Fri Feb 12, 2:59 pm)
Re: [kernel.org users] XZ Migration discussion, Willy Tarreau, (Fri Feb 12, 4:07 pm)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Fri Feb 12, 4:30 pm)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Fri Feb 12, 4:39 pm)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Fri Feb 12, 11:20 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sat Feb 13, 12:20 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sat Feb 13, 12:31 am)
Re: [kernel.org users] XZ Migration discussion, Tony Luck, (Sat Feb 13, 12:42 am)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Sat Feb 13, 1:14 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sat Feb 13, 1:17 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sat Feb 13, 1:53 am)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sat Feb 13, 2:59 am)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sat Feb 13, 3:06 am)
Re: [kernel.org users] XZ Migration discussion, Avi Kivity, (Sat Feb 13, 3:18 am)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sat Feb 13, 3:21 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sat Feb 13, 10:10 am)
Re: [kernel.org users] XZ Migration discussion, Geert Uytterhoeven, (Sat Feb 13, 11:49 am)
Re: [kernel.org users] XZ Migration discussion, Randy Dunlap, (Sat Feb 13, 12:30 pm)
Re: [kernel] Re: [kernel.org users] XZ Migration discussion, Mr. James W. Laferriere, (Sat Feb 13, 2:37 pm)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Sat Feb 13, 3:37 pm)
Re: [kernel] Re: [kernel.org users] XZ Migration discussion, Bernd Petrovitsch, (Sat Feb 13, 3:39 pm)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sat Feb 13, 4:28 pm)
Re: [kernel.org users] XZ Migration discussion, Phillip Lougher, (Sat Feb 13, 4:52 pm)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Sat Feb 13, 10:43 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 2:07 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 2:23 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 2:32 am)
Re: [kernel.org users] XZ Migration discussion, Justin P. Mattock, (Sun Feb 14, 2:33 am)
Re: [kernel.org users] XZ Migration discussion, Willy Tarreau, (Sun Feb 14, 2:49 am)
Re: [kernel.org users] XZ Migration discussion, Justin P. Mattock, (Sun Feb 14, 2:53 am)
Re: [kernel.org users] XZ Migration discussion, Andi Kleen, (Sun Feb 14, 2:56 am)
Re: [kernel.org users] XZ Migration discussion, Lasse Collin, (Sun Feb 14, 2:56 am)
Re: [kernel.org users] XZ Migration discussion, Lasse Collin, (Sun Feb 14, 3:16 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 5:43 am)
Re: [kernel.org users] XZ Migration discussion, Harald Arnesen, (Sun Feb 14, 7:49 am)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Sun Feb 14, 10:07 am)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Sun Feb 14, 10:13 am)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sun Feb 14, 10:33 am)
Re: [kernel.org users] XZ Migration discussion, Eric W. Biederman, (Sun Feb 14, 11:03 am)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Sun Feb 14, 11:34 am)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Sun Feb 14, 11:39 am)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Sun Feb 14, 11:59 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 12:08 pm)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Sun Feb 14, 1:51 pm)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Sun Feb 14, 2:32 pm)
Re: [kernel.org users] XZ Migration discussion, Stephen Hemminger, (Sun Feb 14, 3:27 pm)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Mon Feb 15, 1:48 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Mon Feb 15, 9:15 am)
Re: [kernel.org users] XZ Migration discussion, James Cloos, (Mon Feb 15, 2:31 pm)
Re: [kernel.org users] XZ Migration discussion, Tom Rini, (Mon Feb 15, 4:32 pm)
Re: [kernel.org users] XZ Migration discussion, Stefan Richter, (Tue Feb 16, 1:21 am)
Re: [kernel.org users] [kernel] Re: XZ Migration discussion, Bernd Petrovitsch, (Tue Feb 16, 2:16 am)
Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Tue Feb 16, 7:00 am)
Re: [kernel.org users] XZ Migration discussion, Steven Rostedt, (Tue Feb 16, 7:55 am)
Re: [kernel.org users] XZ Migration discussion, Jean Delvare, (Tue Feb 16, 9:03 am)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Tue Feb 16, 5:11 pm)
Re: [kernel.org users] XZ Migration discussion, David Rees, (Tue Feb 16, 6:36 pm)
Re: [kernel.org users] XZ Migration discussion, Willy Tarreau, (Tue Feb 16, 10:40 pm)
Re: [kernel.org users] XZ Migration discussion, H. Peter Anvin, (Tue Feb 16, 10:54 pm)
Re: [kernel.org users] XZ Migration discussion, Petri Kaukasoina, (Wed Feb 17, 3:22 am)
Re: [kernel.org users] XZ Migration discussion, Petri Kaukasoina, (Wed Feb 17, 3:25 am)
Re: [kernel.org users] XZ Migration discussion, Jan Engelhardt, (Thu Feb 18, 4:59 pm)
Re: [kernel.org users] XZ Migration discussion, Jan Engelhardt, (Thu Feb 18, 5:08 pm)
Re: ketchup was Re: [kernel.org users] XZ Migration discussion, Pavel Machek, (Mon Feb 22, 11:59 am)