2005-08-31 10:47:56 +00:00
|
|
|
# ex:ts=4:sw=4:sts=4:et
|
|
|
|
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2007-01-08 23:53:01 +00:00
|
|
|
#
|
|
|
|
# BitBake Build System Python Library
|
|
|
|
#
|
|
|
|
# Copyright (C) 2003 Holger Schurig
|
|
|
|
# Copyright (C) 2003, 2004 Chris Larson
|
|
|
|
#
|
|
|
|
# Based on Gentoo's portage.py.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# 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.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-08-31 10:47:56 +00:00
|
|
|
|
2010-01-20 18:46:02 +00:00
|
|
|
__version__ = "1.9.0"
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
|
|
|
|
"debug",
|
|
|
|
"note",
|
|
|
|
"error",
|
|
|
|
"fatal",
|
|
|
|
|
|
|
|
"mkdirhier",
|
|
|
|
"movefile",
|
|
|
|
|
|
|
|
"tokenize",
|
|
|
|
"evaluate",
|
|
|
|
"flatten",
|
|
|
|
"relparse",
|
|
|
|
"ververify",
|
|
|
|
"isjustname",
|
|
|
|
"isspecific",
|
|
|
|
"pkgsplit",
|
|
|
|
"catpkgsplit",
|
|
|
|
"vercmp",
|
|
|
|
"pkgcmp",
|
|
|
|
"dep_parenreduce",
|
|
|
|
"dep_opconvert",
|
|
|
|
|
|
|
|
# fetch
|
|
|
|
"decodeurl",
|
|
|
|
"encodeurl",
|
|
|
|
|
|
|
|
# modules
|
|
|
|
"parse",
|
|
|
|
"data",
|
2010-01-20 18:46:02 +00:00
|
|
|
"command",
|
2005-08-31 10:47:56 +00:00
|
|
|
"event",
|
|
|
|
"build",
|
|
|
|
"fetch",
|
2006-05-09 15:44:08 +00:00
|
|
|
"manifest",
|
|
|
|
"methodpool",
|
|
|
|
"cache",
|
2006-11-16 15:02:15 +00:00
|
|
|
"runqueue",
|
|
|
|
"taskdata",
|
|
|
|
"providers",
|
2005-08-31 10:47:56 +00:00
|
|
|
]
|
|
|
|
|
2006-11-16 15:02:15 +00:00
|
|
|
import sys, os, types, re, string, bb
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
#projectdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
|
|
|
|
projectdir = os.getcwd()
|
|
|
|
|
|
|
|
if "BBDEBUG" in os.environ:
|
|
|
|
level = int(os.environ["BBDEBUG"])
|
|
|
|
if level:
|
2006-11-16 15:02:15 +00:00
|
|
|
bb.msg.set_debug_level(level)
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
#######################################################################
|
|
|
|
#
|
|
|
|
# SECTION: Debug
|
|
|
|
#
|
|
|
|
# PURPOSE: little functions to make yourself known
|
|
|
|
#
|
|
|
|
#######################################################################
|
|
|
|
#######################################################################
|
|
|
|
|
2007-08-15 08:39:19 +00:00
|
|
|
def plain(*args):
|
2010-01-21 10:44:34 +00:00
|
|
|
bb.msg.plain(''.join(args))
|
2007-08-15 08:39:19 +00:00
|
|
|
|
2005-08-31 10:47:56 +00:00
|
|
|
def debug(lvl, *args):
|
2007-08-15 08:39:19 +00:00
|
|
|
bb.msg.debug(lvl, None, ''.join(args))
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
def note(*args):
|
2007-08-15 08:39:19 +00:00
|
|
|
bb.msg.note(1, None, ''.join(args))
|
|
|
|
|
|
|
|
def warn(*args):
|
2010-01-21 10:44:34 +00:00
|
|
|
bb.msg.warn(None, ''.join(args))
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
def error(*args):
|
2007-08-15 08:39:19 +00:00
|
|
|
bb.msg.error(None, ''.join(args))
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
def fatal(*args):
|
2007-08-15 08:39:19 +00:00
|
|
|
bb.msg.fatal(None, ''.join(args))
|
2005-08-31 10:47:56 +00:00
|
|
|
|
|
|
|
|
2009-07-19 16:54:46 +00:00
|
|
|
# For compatibility
|
|
|
|
from bb.fetch import MalformedUrl, encodeurl, decodeurl
|
|
|
|
from bb.data import VarExpandError
|
2009-07-19 17:05:52 +00:00
|
|
|
from bb.utils import mkdirhier, movefile, copyfile, which
|
|
|
|
from bb.utils import tokenize, evaluate, flatten
|
|
|
|
from bb.utils import vercmp, pkgcmp, relparse, ververify
|
|
|
|
from bb.utils import pkgsplit, catpkgsplit, isjustname, isspecific
|
|
|
|
from bb.utils import dep_parenreduce, dep_opconvert
|
2009-07-19 16:54:46 +00:00
|
|
|
|
2005-08-31 10:47:56 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
import doctest, bb
|
2009-05-11 21:41:17 +00:00
|
|
|
bb.msg.set_debug_level(0)
|
2005-08-31 10:47:56 +00:00
|
|
|
doctest.testmod(bb)
|