sb: Implement %source and %patch to manage source and patches.

Remove the numbered source and patches and automatically manage
sources and patches. This removes the overhead in maintaining large
collections of patches.
This commit is contained in:
Chris Johns
2014-05-13 23:26:09 +10:00
parent e074e75ef3
commit 9a15c40e1b
71 changed files with 483 additions and 734 deletions

View File

@@ -37,6 +37,7 @@ try:
import options
import path
import pkgconfig
import sources
except KeyboardInterrupt:
print 'user terminated'
sys.exit(1)
@@ -580,6 +581,9 @@ class file:
log.trace('config: %s: _select: %s %s %r' % \
(self.init_name, r, ls[1], self.macros.maps()))
def _sources(self, ls):
return sources.process(ls[0][1:], ls[1:], self.macros, self._error)
def _define(self, config, ls):
if len(ls) <= 1:
log.warning('invalid macro definition')
@@ -796,6 +800,14 @@ class file:
elif ls[0] == '%select':
if isvalid:
self._select(config, ls)
elif ls[0] == '%source' or ls[0] == '%patch':
if isvalid:
d = self._sources(ls)
if d is not None:
return ('data', d)
elif ls[0] == '%patch':
if isvalid:
self._select(config, ls)
elif ls[0] == '%error':
if isvalid:
return ('data', ['%%error %s' % (self._name_line_msg(l[7:]))])