rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
print open( filename ).read() except IOError: print "ERROR: Couldn't open '%s'" % filename def newCommand( params ): """Create a new .bb file and open the editor""" dirname, filename = params packages = '/'.join( data.getVar( "BBFILES", make.cfg, 1 ).split('/')[:-2] ) fulldirname = "%s/%s" % ( packages, dirname ) if ...
cooker.tryBuildPackage( os.path.abspath( bf ), item, bbfile_data ) except build.EventException, e: print "ERROR: Couldn't build '%s'" % name global last_exception last_exception = e make.options.cmd = oldcmd fileBuild.usage = "<bbfile>" def fileClean( self, params ): """Clean a .bb file""" self.fileBuild( params, "cl...
def lastErrorCommand( params ): """Show the reason or log that was produced by the last BitBake event exception""" if last_exception is None: print "SHELL: No Errors yet (Phew)..." else: reason, event = last_exception.args print "SHELL: Reason for the last error: '%s'" % reason if ':' in reason: msg, filename = reason....
inherit base
def newCommand( params ): """Create a new .bb file and open the editor""" dirname, filename = params packages = '/'.join( data.getVar( "BBFILES", make.cfg, 1 ).split('/')[:-2] ) fulldirname = "%s/%s" % ( packages, dirname ) if not os.path.exists( fulldirname ): print "SHELL: Creating '%s'" % fulldirname os.mkdir( full...
newpackage.close() os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) ) def pasteBinCommand( params ): """Send a command + output buffer to http://pastebin.com""" index = params[0] contents = processCommand.memoryOutput.buffer( int( index ) ) status, error, location = sendToPastebin( content...
newpackage.close() os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) ) new.usage = "<directory> <filename>" def pasteBin( self, params ): """Send a command + output buffer to http://pastebin.com""" index = params[0] contents = self._shell.myout.buffer( int( index ) ) status, error, location...
def newCommand( params ): """Create a new .bb file and open the editor""" dirname, filename = params packages = '/'.join( data.getVar( "BBFILES", make.cfg, 1 ).split('/')[:-2] ) fulldirname = "%s/%s" % ( packages, dirname ) if not os.path.exists( fulldirname ): print "SHELL: Creating '%s'" % fulldirname os.mkdir( full...
def completer( text, state ): """Return a possible readline completion""" if debug: print "(completer called with text='%s', state='%d'" % ( text, state ) if state == 0: line = readline.get_line_buffer() if " " in line: line = line.split() if line[0] == "print" or line[0] == "set": allmatches = make.cfg.keys() elif l...
def sendToPastebin( content ): mydata = {} mydata["parent_pid"] = "" mydata["format"] = "bash" mydata["code2"] = content mydata["paste"] = "Send" mydata["poster"] = "%s@%s" % ( os.environ.get( "USER", "unknown" ), socket.gethostname() or "unknown" ) params = urllib.urlencode( mydata ) headers = {"Content-type": "applic...
def init(): """Register commands and set up readline""" registerCommand( "help", showHelp ) registerCommand( "exit", exitShell ) registerCommand( "buffer", bufferCommand, 1, "buffer < registerCommand( "buffers", buffersCommand, 0 ) registerCommand( "build", buildCommand, 1, "build <providee>" ) registerCommand( "clean...
class BitBakeShell: def __init__( self ): """Register commands and set up readline""" self.commands = BitBakeShellCommands( self ) self.myout = MemoryOutput( sys.stdout ) readline.set_completer( completer ) readline.set_completer_delims( " " ) readline.parse_and_bind("tab: complete") try: global history_file readlin...
def isatty( self ): return self.delegate.isatty()
showCredits() init() main() cleanup()
bbshell = BitBakeShell() bbshell.main() bbshell.cleanup()
def start( aCooker ): global cooker cooker = aCooker showCredits() init() main() cleanup()
if line[0] == "print" or line[0] == "set": allmatches = make.cfg.keys() elif line[0].startswith( "file" ): if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] else: allmatches = [ x.split("/")[-1] for x in make.pkgdata.keys() ] elif line[0] == "build" or line[0] == "clean" or line[0] == "whi...
if line[0] in cmds and hasattr( cmds[line[0]][0], "usage" ): u = getattr( cmds[line[0]][0], "usage" ).split()[0] if u == "<variable>": allmatches = make.cfg.keys() elif u == "<bbfile>": if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] else: allmatches = [ x.split("/")[-1] for x in make.pk...
def completer( text, state ): """Return a possible readline completion""" if debug: print "(completer called with text='%s', state='%d'" % ( text, state ) if state == 0: line = readline.get_line_buffer() if " " in line: line = line.split() # we are in second (or more) argument if line[0] == "print" or line[0] == "set"...
self.cachefile = os.path.join(self.cachedir,"bb_cache.dat")
def __init__(self, cooker):
if (self.mtime(self.cachefile)):
if self.has_cache and (self.mtime(self.cachefile)):
def __init__(self, cooker):
if self.cachedir in [None, '']:
if not self.has_cache:
def cacheValid(self, fn): """ Is the cache valid for fn? Fast version, no timestamps checked. """ # Is cache enabled? if self.cachedir in [None, '']: return False if fn in self.clean: return True return False
if self.cachedir in [None, '']:
if not self.has_cache:
def cacheValidUpdate(self, fn): """ Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ # Is cache enabled? if self.cachedir in [None, '']: return False
os.environ['BBPATH'] = os.path.join(path)
os.environ['BBPATH'] = os.path.join(path_937)
def __init__(self): self.__dict__ = { 'abort' : False, 'interactive' : False, 'force' : False, 'cmd' : 'build', 'file' : [], 'verbose' : False, 'debug' : 0, 'dry_run' : False, 'parse_only' : False, 'disable_psyco' : False, 'show_versions' : False, 'show_environment' : False, 'buildfile' : None }
os.chdir(path)
os.chdir(path_937)
def __init__(self): self.__dict__ = { 'abort' : False, 'interactive' : False, 'force' : False, 'cmd' : 'build', 'file' : [], 'verbose' : False, 'debug' : 0, 'dry_run' : False, 'parse_only' : False, 'disable_psyco' : False, 'show_versions' : False, 'show_environment' : False, 'buildfile' : None }
return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__))
return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) - 3)
def __str__(cls): return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__))
def __getmutable__(cls, key):
def __getmutable__(cls, key, readonly=False): nkey = key + MUTABLE try: return cls.__dict__[nkey] except KeyError: pass value = getattr(cls, nkey) if readonly: return value if not cls.__warn__ is False and not isinstance(value, COWMeta): print >> cls.__warn__, "Warning: Doing a copy because %s is a mutable type." % k...
def __getmutable__(cls, key): """ This gets called when you do a "o.b" and b doesn't exist on o.
This gets called when you do a "o.b" and b doesn't exist on o. IE When the type is mutable. """ nkey = key + MUTABLE if nkey in cls.__dict__: return cls.__dict__[nkey] r = getattr(cls, nkey) try: r = r.copy() except NameError, e: r = copy.copy(r) setattr(cls, nkey, r) return r def __getitem__(cls, key):
return cls.__getitem__(key, default, True) def __getitem__(cls, key, default=__getmarker__, readonly=False):
def __getmutable__(cls, key): """ This gets called when you do a "o.b" and b doesn't exist on o.
return getattr(cls, key)
value = getattr(cls, key)
def __getitem__(cls, key): try: try: return getattr(cls, key) except AttributeError: # Degrade to slow mode if type is not immutable, # If the type is also a COW this will be cheap anyway return cls.__getmutable__(key) except AttributeError, e: raise KeyError(e)
return cls.__getmutable__(key)
value = cls.__getmutable__(key, readonly) if value is cls.__marker__: raise AttributeError("key %s does not exist." % key) return value
def __getitem__(cls, key): try: try: return getattr(cls, key) except AttributeError: # Degrade to slow mode if type is not immutable, # If the type is also a COW this will be cheap anyway return cls.__getmutable__(key) except AttributeError, e: raise KeyError(e)
raise KeyError(e)
if not default is cls.__getmarker__: return default raise KeyError(str(e)) def __delitem__(cls, key): cls.__setitem__(key, cls.__marker__) def __revertitem__(cls, key): if not cls.__dict__.has_key(key): key += MUTABLE delattr(cls, key)
def __getitem__(cls, key): try: try: return getattr(cls, key) except AttributeError: # Degrade to slow mode if type is not immutable, # If the type is also a COW this will be cheap anyway return cls.__getmutable__(key) except AttributeError, e: raise KeyError(e)
return (hasattr(cls, key) or hasattr(cls, key + MUTABLE)) def iter(cls, type):
value = cls.__getreadonly__(key, cls.__marker__) if value is cls.__marker__: return False return True def iter(cls, type, readonly=False):
def has_key(cls, key): return (hasattr(cls, key) or hasattr(cls, key + MUTABLE))
yield cls[key]
yield value
def iter(cls, type): for key in dir(cls): if key.startswith("__"): continue
yield (key, cls[key])
yield (key, value)
def iter(cls, type): for key in dir(cls): if key.startswith("__"): continue
def itervalues(cls): return cls.iter("values") def iteritems(cls): return cls.iter("items") copy = cow
def itervalues(cls, readonly=False): if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False: print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True." return cls.iter("values", readonly) def iteritems(cls, readonly=False): if not cls.__warn__ is False and cls.__...
def itervalues(cls): return cls.iter("values")
return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__))
return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) -3)
def __str__(cls): return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__))
def add(cls, key, value): cls.__setitem__(hash(key), value)
def add(cls, value): COWDictMeta.__setitem__(cls, repr(hash(value)), value) def remove(cls, value): COWDictMeta.__delitem__(cls, repr(hash(value))) def __in__(cls, value): return COWDictMeta.has_key(repr(hash(value))) def iterkeys(cls): raise TypeError("sets don't have keys") def iteritems(cls): raise TypeError("se...
def add(cls, key, value): cls.__setitem__(hash(key), value)
a = COWDictBase.copy() print a
import sys COWDictBase.__warn__ = sys.stderr a = COWDictBase() print "a", a
def add(cls, key, value): cls.__setitem__(hash(key), value)
print "ha" hasattr(a, "a") print "ha"
def add(cls, key, value): cls.__setitem__(hash(key), value)
print b b['b'] = 'b' for x in a.iteritems(): print x print "--"
print "b", b b['c'] = 'b' print print "a", a for x in a.iteritems(): print x print "--" print "b", b
def add(cls, key, value): cls.__setitem__(hash(key), value)
for x in a.iteritems(): print x print "--"
print "a", a for x in a.iteritems(): print x print "--" print "b", b
def add(cls, key, value): cls.__setitem__(hash(key), value)
a['set'] = COWSetBase() a['set'].add("o1") a['set'].add("o1") a['set'].add("o2") print "a", a for x in a['set'].itervalues(): print x print "--" print "b", b for x in b['set'].itervalues(): print x print b['set'].add('o3') print "a", a for x in a['set'].itervalues(): print x print "--" print "b", b for x in b['set']...
def add(cls, key, value): cls.__setitem__(hash(key), value)
bb.note("Cache: %s is not cached" % fn)
bb.debug(2, "Cache: %s is not cached" % fn)
def cacheValidUpdate(self, fn): """ Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ # Is cache enabled? if self.cachedir in [None, '']: return False
bb.note("Cache: %s changed" % fn)
bb.debug(2, "Cache: %s changed" % fn)
def cacheValidUpdate(self, fn): """ Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ # Is cache enabled? if self.cachedir in [None, '']: return False
bb.note("Cache: %s's dependency %s changed" % (fn, f))
bb.debug(2, "Cache: %s's dependency %s changed" % (fn, f))
def cacheValidUpdate(self, fn): """ Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ # Is cache enabled? if self.cachedir in [None, '']: return False
bb.debug(2, "Depends Cache: %s is clean" % fn)
def cacheValidUpdate(self, fn): """ Is the cache valid for fn? Make thorough (slower) checks including timestamps. """ # Is cache enabled? if self.cachedir in [None, '']: return False
dependids = []
dependids = {}
def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """
dependids.append(self.getbuild_id(depend)) self.depids[fnid] = dependids
dependids[self.getbuild_id(depend)] = None self.depids[fnid] = dependids.keys()
def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """
rdependids = []
rdependids = {}
def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """
rdependids.append(self.getrun_id(rdepend))
rdependids[self.getrun_id(rdepend)] = None
def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """
rdependids.append(self.getrun_id(rdepend)) self.rdepids[fnid] = rdependids
rdependids[self.getrun_id(rdepend)] = None self.rdepids[fnid] = rdependids.keys()
def add_tasks(self, fn, dataCache): """ Add tasks for a given fn to the database """
bb.msg.debug(3, bb.msg.domain.TaskData, "runtime ids (per fn):") for fnid in self.rdepids: bb.msg.debug(3, bb.msg.domain.TaskData, " %s %s: %s" % (fnid, self.fn_index[fnid], self.rdepids[fnid]))
def dump_data(self): """ Dump some debug information on the internal data structures """ bb.msg.debug(3, bb.msg.domain.TaskData, "build_names:") bb.msg.debug(3, bb.msg.domain.TaskData, ", ".join(self.build_names_index)) bb.msg.debug(3, bb.msg.domain.TaskData, "run_names:") bb.msg.debug(3, bb.msg.domain.TaskData, ", ".j...
self.fileClean( params ) self.fileBuild( params )
self.fileBuild( params, "rebuild" )
def fileRebuild( self, params ): """Rebuild (clean & build) a .bb file""" self.fileClean( params ) self.fileBuild( params )
lv, lf, pv, pf = bb.providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, cooker.build_cache_fail)
lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, cooker.build_cache_fail)
def which( self, params ): """Computes the providers for a given providee""" item = params[0]
if 'BBDEBUG' in env and (env['BBDEBUG'] >= str(lvl)):
if debug_level >= lvl:
def debug(lvl, *args): if 'BBDEBUG' in env and (env['BBDEBUG'] >= str(lvl)): print debug_prepend + 'DEBUG:', ''.join(args)
try: bb.build.exec_func('do_clean', data) except: pass
def test(self,file, data): """ Run the Test now... some duplication of the base.bbclass """
bb.build.exec_func('do_clean', data)
def test(self,file, data): """ Run the Test now... some duplication of the base.bbclass """
o.write("%s() {\n%s\n}\n" % (var, val))
o.write("%s() {\n%s\n}\n" % (varExpanded, val))
def emit_var(var, o=sys.__stdout__, d = init(), all=False): """Emit a variable to be sourced by a shell.""" if getVarFlag(var, "python", d): return 0 try: if all: oval = getVar(var, d, 0) val = getVar(var, d, 1) except KeyboardInterrupt: raise except: excname = str(sys.exc_info()[0]) if excname == "bb.build.FuncFailed...
o.write('%s="%s"\n' % (var, alter))
o.write('%s="%s"\n' % (varExpanded, alter))
def emit_var(var, o=sys.__stdout__, d = init(), all=False): """Emit a variable to be sourced by a shell.""" if getVarFlag(var, "python", d): return 0 try: if all: oval = getVar(var, d, 0) val = getVar(var, d, 1) except KeyboardInterrupt: raise except: excname = str(sys.exc_info()[0]) if excname == "bb.build.FuncFailed...
(type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d))
def localpath(url, d): (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d))
if "localpath" in parm: return parm["localpath"] tag = gettag(parm) localname = data.expand('git_%s%s_%s.tar.gz' % (host, path.replace('/', '.'), tag), d) return os.path.join(data.getVar("DL_DIR", d, 1),data.expand('%s' % (localname), d))
return os.path.join(data.getVar("DL_DIR", d, 1), localfile(url, d))
def localpath(url, d): (type, host, path, user, pswd, parm) = bb.decodeurl(data.expand(url, d))
repofile = os.path.join(data.getVar("DL_DIR", d, 1), 'git_%s.tar.gz' % (gitsrcname))
repofilename = 'git_%s.tar.gz' % (gitsrcname) repofile = os.path.join(data.getVar("DL_DIR", d, 1), repofilename)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
if os.access(cofile, os.R_OK): bb.debug(1, "%s already exists, skipping git checkout." % cofile)
if (tag != "master") and Fetch.try_mirror(d, localfile(loc, d)): bb.debug(1, "%s already exists (or was stashed). Skipping git checkout." % cofile)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
if not os.path.exists(repodir): if Fetch.try_mirror(d, repofilename): bb.mkdirhier(repodir) os.chdir(repodir) rungitcmd("tar -xzf %s" % (repofile),d) else: rungitcmd("git clone %s://%s%s %s" % (proto, host, path, repodir),d)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
os.chdir(repodir) rungitcmd("git pull %s://%s%s" % (proto, host, path),d) rungitcmd("git pull --tags %s://%s%s" % (proto, host, path),d)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
if os.access(repofile, os.R_OK): bb.mkdirhier(repodir) os.chdir(repodir) rungitcmd("tar -xzf %s" % (repofile),d) else: rungitcmd("git clone rsync://%s%s %s" % (host, path, repodir),d) rungitcmd("rsync -a --verbose --stats --progress rsync://%s%s/ %s" % (host, path, os.path.join(repodir, ".git", "")),d)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
rungitcmd("git pull rsync://%s%s" % (host, path),d) os.chdir(repodir)
bb.note("Creating tarball of git repository")
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
if False
if False:
def fileReparse( self, params ): """(re)Parse a bb file""" bbfile = params[0] print "SHELL: Parsing '%s'" % bbfile parse.update_mtime( bbfile ) cooker.bb_cache.cacheValidUpdate(bbfile) fromCache = cooker.bb_cache.loadData(bbfile, cooker) cooker.bb_cache.sync() if False #fromCache: print "SHELL: File has not been update...
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None):
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None): """ If there is a PREFERRED_VERSION, find the highest-priority bbfile providing that version. If not, find the latest version provided by an bbfile in the highest-priority set. """ if not pkg_pn: pkg_pn = dataCache.pkg_pn files = pkg_pn[pn] priorities = {} ...
bb.msg.note(1, bb.msg.domain.Provider, "preferred version %s of %s not available" % (pv_str, pn))
bb.msg.note(1, bb.msg.domain.Provider, "preferred version %s of %s not available%s" % (pv_str, pn, itemstr))
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None): """ If there is a PREFERRED_VERSION, find the highest-priority bbfile providing that version. If not, find the latest version provided by an bbfile in the highest-priority set. """ if not pkg_pn: pkg_pn = dataCache.pkg_pn files = pkg_pn[pn] priorities = {} ...
bb.msg.debug(1, bb.msg.domain.Provider, "selecting %s as PREFERRED_VERSION %s of package %s" % (preferred_file, pv_str, pn))
bb.msg.debug(1, bb.msg.domain.Provider, "selecting %s as PREFERRED_VERSION %s of package %s%s" % (preferred_file, pv_str, pn, itemstr))
def findBestProvider(pn, cfgData, dataCache, pkg_pn = None): """ If there is a PREFERRED_VERSION, find the highest-priority bbfile providing that version. If not, find the latest version provided by an bbfile in the highest-priority set. """ if not pkg_pn: pkg_pn = dataCache.pkg_pn files = pkg_pn[pn] priorities = {} ...
preferred_versions[pn] = bb.providers.findBestProvider(pn, cfgData, dataCache, pkg_pn)[2:4]
preferred_versions[pn] = bb.providers.findBestProvider(pn, cfgData, dataCache, pkg_pn, item)[2:4]
def filterProviders(providers, item, cfgData, dataCache, build_cache_fail = {}): """ Take a list of providers and filter/reorder according to the environment variables and previous build results """ eligible = [] preferred_versions = {} # Collate providers by PN pkg_pn = {} for p in providers: pn = dataCache.pkg_fn[p]...
os.chdir(topdir)
if self.mtime(topdir): os.chdir(topdir)
def load_bbfile( self, bbfile , cooker): """ Load and parse one .bb build file Return the data and whether parsing resulted in the file being skipped """
if data.getVar("BBDEBUG", d): f.write("set -x\n")
if bb.debug_level > 0: f.write("set -x\n")
def exec_func_shell(func, d): """Execute a shell BB 'function' Returns true if execution was successful. For this, it creates a bash shell script in the tmp dectory, writes the local data into it and finally executes. The output of the shell will end in a log file and stdout. Note on directory behavior. The 'dirs' v...
if data.getVar("BBDEBUG", d):
if bb.debug_level > 0:
def exec_func_shell(func, d): """Execute a shell BB 'function' Returns true if execution was successful. For this, it creates a bash shell script in the tmp dectory, writes the local data into it and finally executes. The output of the shell will end in a log file and stdout. Note on directory behavior. The 'dirs' v...
if not data.getVar("BBDEBUG", d):
if bb.debug_level > 0:
def exec_func_shell(func, d): """Execute a shell BB 'function' Returns true if execution was successful. For this, it creates a bash shell script in the tmp dectory, writes the local data into it and finally executes. The output of the shell will end in a log file and stdout. Note on directory behavior. The 'dirs' v...
item = dataCache.pkg_fn[fn]
def add_provider(self, cfgData, dataCache, item, external = True): """ Add the providers of item to the task data Mark entries were specifically added externally as against dependencies added internally during dependency resolution """
svncmd = "svn co %s://%s/%s" % (proto, svnroot, module)
svncmd = "svn co -r {%s} %s://%s/%s" % (date, proto, svnroot, module)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
registerCommand( "rebuild", rebuildCommand )
def init(): """Register commands and set up readline""" registerCommand( "help", showHelp ) registerCommand( "exit", exitShell ) registerCommand( "build", buildCommand ) registerCommand( "environment", environmentCommand ) registerCommand( "rebuild", rebuildCommand ) registerCommand( "parse", parseCommand ) registerCo...
def exitShell( params ): """Leave the BitBake Shell""" sys.exit(0)
try: global history_file readline.read_history_file( history_file ) except IOError: pass def cleanup(): if debug: print "(writing command history)" try: global history_file readline.write_history_file( history_file ) except: print "BBSHELL: Unable to save command history"
def exitShell( params ): """Leave the BitBake Shell""" sys.exit(0)
while True:
while not leave_mainloop:
def main(): while True: try: cmdline = raw_input( "BB>> " ) if cmdline: if ' ' in cmdline: processCommand( cmdline.split()[0], cmdline.split()[1:] ) else: processCommand( cmdline, "" ) except EOFError: print return except KeyboardInterrupt: print
gitsrcname = '%s%s' % (ud.host, path.replace('/', '.'))
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
def go(self, loc, ud, d): """Fetch url"""
number_tasks = int(bb.data.getVar("BB_NUMBER_THREADS", cfgData)) if not number_tasks: number_tasks = 1
number_tasks = int(bb.data.getVar("BB_NUMBER_THREADS", cfgData) or 1)
def get_user_idstring(task): fn = taskData.fn_index[self.runq_fnid[task]] taskname = self.runq_task[task] return "%s, %s" % (fn, taskname)
def testUpdateData(self):
def testUpdateData1(self): from bb import data from bb import data_smart
def testUpdateData(self): pass
start = self.dict while start: if item in start: return start[item] elif "_data" in start: start = start["_data"] else: start = None return None
print "Warning deprecated" return self.getVar(item, False)
def __getitem__(self,item): start = self.dict while start: if item in start: return start[item] elif "_data" in start: start = start["_data"] else: start = None return None
self._makeShadowCopy(var) self.dict[var] = data
print "Warning deprecated" self.setVar(var,data)
def __setitem__(self,var,data): self._makeShadowCopy(var) self.dict[var] = data
if fromCache:
if False
def fileReparse( self, params ): """(re)Parse a bb file""" bbfile = params[0] print "SHELL: Parsing '%s'" % bbfile parse.update_mtime( bbfile ) cooker.bb_cache.cacheValidUpdate(bbfile) fromCache = cooker.bb_cache.loadData(bbfile, cooker) cooker.bb_cache.sync() if fromCache: print "SHELL: File has not been updated, not ...
conn = httplib.HTTPConnection( "pastebin.com:80" )
conn = httplib.HTTPConnection( "oe.pastebin.com:80" )
def sendToPastebin( content ): """Send content to http://www.pastebin.com""" mydata = {} mydata["parent_pid"] = "" mydata["format"] = "bash" mydata["code2"] = content mydata["paste"] = "Send" mydata["poster"] = "%s@%s" % ( os.environ.get( "USER", "unknown" ), socket.gethostname() or "unknown" ) params = urllib.urlencod...
start = self.dict while start: if item in start: return start[item] elif "_data" in start: start = start["_data"] else: start = None return None
return self.getVar(item, False)
def __getitem__(self,item): start = self.dict while start: if item in start: return start[item] elif "_data" in start: start = start["_data"] else: start = None return None
self._makeShadowCopy(var) self.dict[var] = data
self.setVar(var,data)
def __setitem__(self,var,data): self._makeShadowCopy(var) self.dict[var] = data
def print_chain(taskid):
deps_seen = [] def print_chain(taskid, finish):
def print_chain(taskid): seen.append(taskid) for revdep in self.runq_revdeps[taskid]: if runq_done[revdep] == 0: bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) (depends: %s)" % (revdep, self.get_user_idstring(revdep, taskData), self.runq_depends[revdep])) if revdep not in seen: print_chain(revdep)
if runq_done[revdep] == 0:
if runq_done[revdep] == 0 and revdep not in seen and not finish:
def print_chain(taskid): seen.append(taskid) for revdep in self.runq_revdeps[taskid]: if runq_done[revdep] == 0: bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) (depends: %s)" % (revdep, self.get_user_idstring(revdep, taskData), self.runq_depends[revdep])) if revdep not in seen: print_chain(revdep)
if revdep not in seen: print_chain(revdep) print_chain(task)
if revdep in deps_seen: bb.msg.error(bb.msg.domain.RunQueue, "Chain ends at Task %s (%s)" % (revdep, self.get_user_idstring(revdep, taskData))) finish = True return for dep in self.runq_depends[revdep]: deps_seen.append(dep) print_chain(revdep, finish) print_chain(task, False)
def print_chain(taskid): seen.append(taskid) for revdep in self.runq_revdeps[taskid]: if runq_done[revdep] == 0: bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) (depends: %s)" % (revdep, self.get_user_idstring(revdep, taskData), self.runq_depends[revdep])) if revdep not in seen: print_chain(revdep)
return lambda fn,value : [TestItem(fn,False,"HOMEPAGE is not set %s" % value), None] [toInt(value == 'unknown')]
return lambda fn,value : [None,TestItem(fn,False,"HOMEPAGE is not set %s" % value)] [value == 'unknown']
def homepage1(): return lambda fn,value : [TestItem(fn,False,"HOMEPAGE is not set %s" % value), None] [toInt(value == 'unknown')]
return lambda fn,value : [TestItem(fn,False,"HOMEPAGE doesn't start with http://"), None][toInt(not value.startswith("http://"))]
return lambda fn,value : [None,TestItem(fn,False,"HOMEPAGE doesn't start with http://")][not value.startswith("http://")]
def homepage2(): return lambda fn,value : [TestItem(fn,False,"HOMEPAGE doesn't start with http://"), None][toInt(not value.startswith("http://"))]
return lambda fn,value : [TestItem(fn,False, "explicit MAINTAINER is missing, using default"), None][toInt(value == "OpenEmbedded Team <oe@handhelds.org>")]
return lambda fn,value : [None,TestItem(fn,False, "explicit MAINTAINER is missing, using default"), None][value == "OpenEmbedded Team <oe@handhelds.org>"]
def maintainer1(): return lambda fn,value : [TestItem(fn,False, "explicit MAINTAINER is missing, using default"), None][toInt(value == "OpenEmbedded Team <oe@handhelds.org>")]
return lambda fn, value : [TestItem(fn,False,"You forgot to put an e-mail address into MAINTAINER"),None] [toInt(value.find("@") == -1)]
return lambda fn, value : [None,TestItem(fn,False,"You forgot to put an e-mail address into MAINTAINER"),None] [value.find("@") == -1]
def maintainer2(): return lambda fn, value : [TestItem(fn,False,"You forgot to put an e-mail address into MAINTAINER"),None] [toInt(value.find("@") == -1)]
return lambda fn, value : [TestItem(fn,False,"LICENSE '%s' is not known" % value),None][toInt(not valid_licenses.has_key(value))]
return lambda fn, value : [None,TestItem(fn,False,"LICENSE '%s' is not known" % value),None][not valid_licenses.has_key(value)]
def license2(): return lambda fn, value : [TestItem(fn,False,"LICENSE '%s' is not known" % value),None][toInt(not valid_licenses.has_key(value))]
return lambda fn, value : [TestItem(fn,False,"LICENSE '%s' is not recommed, better use '%s'" % (value,valid_licenses[value])),None][toInt(valid_licenses[value] != True)]
return lambda fn, value : [None,TestItem(fn,False,"LICENSE '%s' is not recommed, better use '%s'" % (value,valid_licenses[value])),None][valid_licenses[value] != True]
def license3(): return lambda fn, value : [TestItem(fn,False,"LICENSE '%s' is not recommed, better use '%s'" % (value,valid_licenses[value])),None][toInt(valid_licenses[value] != True)]
return lambda fn, value : [TestItem(fn,False,"LICENSE is not set %s" % value),None][toInt(value == "unknown")]
return lambda fn, value : [None,TestItem(fn,False,"LICENSE is not set %s" % value)][value == "unknown"]
def license1(): return lambda fn, value : [TestItem(fn,False,"LICENSE is not set %s" % value),None][toInt(value == "unknown")]
return lambda fn, value : [TestItem(fn,False,"PRIORITY '%s' is not recommed" % value), None][toInt(valid_priorities[value]==False)]
return lambda fn, value : [None,TestItem(fn,False,"PRIORITY '%s' is not known" % value)][not valid_priorities.has_key(value)] def priority2(): return lambda fn, value : [None,TestItem(fn,False,"PRIORITY '%s' is not recommed" % value)][valid_priorities[value]==False] valid_sections = { "apps" : True, "audio" : ...
def priority1(): return lambda fn, value : [TestItem(fn,False,"PRIORITY '%s' is not recommed" % value), None][toInt(valid_priorities[value]==False)]
'SECTION' : None, 'PRIORITY' : None
'SECTION' : [section1(),section2()], 'PRIORITY' : [priority1(), priority2()],
def priority1(): return lambda fn, value : [TestItem(fn,False,"PRIORITY '%s' is not recommed" % value), None][toInt(valid_priorities[value]==False)]
src_tarball_stash = data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) if src_tarball_stash:
src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split() for stash in src_tarball_stash:
def try_mirror(d, tarfn): """ Try to use a mirrored version of the sources. We do this to avoid massive loads on foreign cvs and svn servers. This method will be used by the different fetcher implementations.
uri = src_tarball_stash + tarfn
uri = stash + tarfn
def try_mirror(d, tarfn): """ Try to use a mirrored version of the sources. We do this to avoid massive loads on foreign cvs and svn servers. This method will be used by the different fetcher implementations.
bb.fetch.init(data, src_uri.split())
bb.fetch.init(src_uri.split(), data)
def test(self,file, data): # we run the tests
data.setVar('SVNROOT', svnroot, localdata)
if revision: options.append("-r %s" % revision) elif date != "now": options.append("-r {%s}" % date) data.setVar('SVNROOT', "%s://%s/%s" % (proto, svnroot, module), localdata)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
svncmd = "svn co -r {%s} %s://%s/%s" % (date, proto, svnroot, module) if revision: svncmd = "svn co -r %s %s://%s/%s" % (revision, proto, svnroot, module) elif date == "now": svncmd = "svn co %s://%s/%s" % (proto, svnroot, module)
svnupcmd = data.getVar('UPDATECOMMAND', localdata, 1)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
bb.debug(2, "Fetch: creating temporary directory") bb.mkdirhier(data.expand('${WORKDIR}', localdata)) data.setVar('TMPBASE', data.expand('${WORKDIR}/oesvn.XXXXXX', localdata), localdata) tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false") tmpfile = tmppipe.readline().strip() if not tmpfile: bb.erro...
pkg=data.expand('${PN}', d) pkgdir=os.path.join(data.expand('${SVNDIR}', localdata), pkg) moddir=os.path.join(pkgdir, module) bb.debug(2, "Fetch: checking for module directory '" + moddir + "'") if os.access(os.path.join(moddir,'.svn'), os.R_OK): bb.note("Update " + loc) os.chdir(moddir) bb.debug(1, "Running %s" % sv...
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
os.chdir(tmpfile) bb.note("Fetch " + loc) bb.debug(1, "Running %s" % svncmd) myret = os.system(svncmd) if myret != 0: try: os.rmdir(tmpfile) except OSError: pass raise FetchError(module) os.chdir(os.path.join(tmpfile, os.path.dirname(module)))
os.chdir(pkgdir)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
os.system('rm -rf %s' % tmpfile)
def go(self, d, urls = []): """Fetch urls""" if not urls: urls = self.urls
os.system( "%s %s" % ( os.environ.get( "EDITOR" ), name ) )
os.system( "%s %s" % ( os.environ.get( "EDITOR" ), completeFilePath( name ) ) )
def editCommand( params ): """Call $EDITOR on a .bb file""" try: name = params[0] except IndexError: print "Usage: edit <bbfile>" else: os.system( "%s %s" % ( os.environ.get( "EDITOR" ), name ) )
def setVarCommand( params ): """Set an outer BitBake environment variable""" try: var, value = params except ValueError, IndexError: print "Usage: set <variable> <value>" else: data.setVar( var, value, make.cfg ) print "OK"
def whichCommand( params ): """Computes the preferred and latest provider for a given dependency""" try: var = params[0] except IndexError: print "Usage: which <provider>" else: print "Sorry, not yet implemented"
def setVarCommand( params ): """Set an outer BitBake environment variable""" try: var, value = params except ValueError, IndexError: print "Usage: set <variable> <value>" else: data.setVar( var, value, make.cfg ) print "OK"