diff options
-rw-r--r-- | MANIFEST | 5 | ||||
-rw-r--r-- | lib/bb/parse/__init__.py | 76 | ||||
-rw-r--r-- | lib/bb/parse/parse_py/BBHandler.py (renamed from lib/bb/parse/BBHandler.py) | 2 | ||||
-rw-r--r-- | lib/bb/parse/parse_py/ConfHandler.py (renamed from lib/bb/parse/ConfHandler.py) | 0 | ||||
-rw-r--r-- | lib/bb/parse/parse_py/__init__.py | 32 |
5 files changed, 36 insertions, 79 deletions
@@ -11,9 +11,10 @@ lib/bb/data_smart.py lib/bb/event.py lib/bb/fetch.py lib/bb/manifest.py -lib/bb/parse/BBHandler.py -lib/bb/parse/ConfHandler.py lib/bb/parse/__init__.py +lib/bb/parse/parse_py/BBHandler.py +lib/bb/parse/parse_py/ConfHandler.py +lib/bb/parse/parse_py/__init__.py lib/bb/shell.py lib/bb/utils.py doc/COPYING.GPL diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py deleted file mode 100644 index 8877b6f40..000000000 --- a/lib/bb/parse/__init__.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# ex:ts=4:sw=4:sts=4:et -# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- -""" -BitBake Parsers - -File parsers for the BitBake build tools. - -Copyright (C) 2003, 2004 Chris Larson -Copyright (C) 2003, 2004 Phil Blundell - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 2 of the License, or (at your option) any later -version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 59 Temple -Place, Suite 330, Boston, MA 02111-1307 USA. - -Based on functions from the base bb module, Copyright 2003 Holger Schurig -""" -__version__ = '1.0' - -__all__ = [ 'handlers', 'supports', 'handle', 'init', 'ConfHandler', 'BBHandler', 'ParseError' ] -handlers = [] - -class ParseError(Exception): - """Exception raised when parsing fails""" - -class SkipPackage(Exception): - """Exception raised to skip this package""" - -import ConfHandler -ConfHandler.ParseError = ParseError -import BBHandler -BBHandler.ParseError = ParseError - -__mtime_cache = {} - -def cached_mtime(f): - import os - if not __mtime_cache.has_key(f): - __mtime_cache[f] = os.stat(f)[8] - return __mtime_cache[f] - -def mark_dependency(d, f): - import bb, os - if f.startswith('./'): - f = "%s/%s" % (os.getcwd(), f[2:]) - deps = (bb.data.getVar('__depends', d) or "").split() - deps.append("%s@%s" % (f, cached_mtime(f))) - bb.data.setVar('__depends', " ".join(deps), d) - -def supports(fn, data): - """Returns true if we have a handler for this file, false otherwise""" - for h in handlers: - if h['supports'](fn, data): - return 1 - return 0 - -def handle(fn, data, include = 0): - """Call the handler that is appropriate for this file""" - for h in handlers: - if h['supports'](fn, data): - return h['handle'](fn, data, include) - raise ParseError("%s is not a BitBake file" % fn) - -def init(fn, data): - for h in handlers: - if h['supports'](fn): - return h['init'](data) diff --git a/lib/bb/parse/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py index d38668505..7419ca732 100644 --- a/lib/bb/parse/BBHandler.py +++ b/lib/bb/parse/parse_py/BBHandler.py @@ -25,7 +25,7 @@ import re, bb, os, sys import bb.fetch, bb.build from bb import debug, data, fetch, fatal -from bb.parse.ConfHandler import include, localpath, obtain, init +from ConfHandler import include, localpath, obtain, init from bb.parse import ParseError __func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) diff --git a/lib/bb/parse/ConfHandler.py b/lib/bb/parse/parse_py/ConfHandler.py index 70451d649..70451d649 100644 --- a/lib/bb/parse/ConfHandler.py +++ b/lib/bb/parse/parse_py/ConfHandler.py diff --git a/lib/bb/parse/parse_py/__init__.py b/lib/bb/parse/parse_py/__init__.py new file mode 100644 index 000000000..6a2ce4059 --- /dev/null +++ b/lib/bb/parse/parse_py/__init__.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +""" +BitBake Parsers + +File parsers for the BitBake build tools. + +Copyright (C) 2003, 2004 Chris Larson +Copyright (C) 2003, 2004 Phil Blundell + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA. + +Based on functions from the base bb module, Copyright 2003 Holger Schurig +""" +__version__ = '1.0' + +__all__ = [ 'ConfHandler', 'BBHandler'] + +import ConfHandler +import BBHandler |