backports: make kconfig src_line backport / ConfigTree specific
authorLuis R. Rodriguez <mcgrof@suse.com>
Fri, 7 Nov 2014 22:47:06 +0000 (14:47 -0800)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Fri, 14 Nov 2014 21:47:16 +0000 (13:47 -0800)
The kconfig source line used on a backport project is very
project specific. For backport packaging the source line simply
should follow the full path of the project but for integration
this will vary depending on the backport prefix directory used.
We'll add support for that next.

$ time /home/mcgrof/backports/devel/ckmake --allyesconfig
1   3.0.101             [  OK  ]
2   3.1.10              [  OK  ]
3   3.2.62              [  OK  ]
4   3.3.8               [  OK  ]
5   3.4.104             [  OK  ]
6   3.5.7               [  OK  ]
7   3.6.11              [  OK  ]
8   3.7.10              [  OK  ]
9   3.8.13              [  OK  ]
10  3.9.11              [  OK  ]
11  3.10.58             [  OK  ]
12  3.11.10             [  OK  ]
13  3.12.31             [  OK  ]
14  3.13.11             [  OK  ]
15  3.14.22             [  OK  ]
16  3.15.10             [  OK  ]
17  3.16.6              [  OK  ]
18  3.17.1              [  OK  ]
19  3.18-rc1            [  OK  ]

real    43m56.439s
user    1187m4.516s
sys     138m53.328s

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
lib/kconfig.py

index f348d4a6deee276c8b8d87f443b24c7931e1d52f..ac96613ee073db2c1c23059db5ca4245c315bead 100644 (file)
@@ -4,7 +4,6 @@
 
 import os, re
 
-src_line = re.compile(r'^\s*source\s+"(?P<src>[^\s"]*)"?\s*$')
 src_line_rel = re.compile(r'^\s*source\s+(?P<src>[^\s"]*)"?\s*$')
 tri_line = re.compile(r'^(?P<spc>\s+)tristate')
 bool_line = re.compile(r'^(?P<spc>\s+)bool')
@@ -16,6 +15,7 @@ class ConfigTree(object):
     def __init__(self, rootfile, bpid):
         self.bpid = bpid
         self.rootfile = os.path.basename(rootfile)
+        self.src_line = re.compile(r'^\s*source\s+"(?P<src>[^\s"]*)"?\s*$')
 
     def _check_relative_source(self, f, l):
     #
@@ -31,7 +31,7 @@ class ConfigTree(object):
     def _walk(self, f):
         yield f
         for l in open(os.path.join(self.bpid.target_dir, f), 'r'):
-            m = src_line.match(l)
+            m = self.src_line.match(l)
             if m and os.path.exists(os.path.join(self.bpid.target_dir, m.group('src'))):
                 for i in self._walk(m.group('src')):
                     yield i
@@ -42,7 +42,7 @@ class ConfigTree(object):
         for nf in self._walk(f):
             out = ''
             for l in open(os.path.join(self.bpid.target_dir, nf), 'r'):
-                m = src_line.match(l)
+                m = self.src_line.match(l)
                 if not m:
                     self._check_relative_source(nf, l)
                     out += l