#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell # Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer # Copyright (C) 2005 Holger Hans Peter Freyther # Copyright (C) 2005 ROAD GmbH # Copyright (C) 2006 Richard Purdie # # 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. import os, sys from functools import wraps import logging from bb import data logger = logging.getLogger("BitBake") parselog = logging.getLogger("BitBake.Parsing") class ConfigParameters(object): def __init__(self): self.options, targets = self.parseCommandLine() self.environment = self.parseEnvironment() self.options.pkgs_to_build = targets or [] self.options.tracking = False if self.options.show_environment: self.options.tracking = True for key, val in self.options.__dict__.items(): setattr(self, key, val) def parseCommandLine(self): raise Exception("Caller must implement commandline option parsing") def parseEnvironment(self): return os.environ.copy() class CookerConfiguration(object): """ Manages build options and configurations for one run """ def __init__(self): self.debug_domains = [] self.extra_assume_provided = [] self.prefile = [] self.postfile = [] self.debug = 0 self.pkgs_to_build = [] def setConfigParameters(self, parameters): self.params = parameters for key, val in parameters.options.__dict__.items(): setattr(self, key, val) def setServerRegIdleCallback(self, srcb): self.server_register_idlecallback = srcb