diff options
author | Richard Purdie <richard@openedhand.com> | 2006-05-09 15:44:08 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-05-09 15:44:08 +0000 |
commit | 27dba1e6247ae48349aee1bce141a9eefaafaad1 (patch) | |
tree | 822235005ccbd2707f7874ad680dedc4df36760c /bitbake/lib/bb/shell.py | |
parent | ed234aca98d0867c7b32801fc63820b19cf67df9 (diff) | |
download | poky-27dba1e6247ae48349aee1bce141a9eefaafaad1.tar.gz |
Update to bitbake 1.4.2 (latest stable branch release). This includes the caching speedups
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@371 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/shell.py')
-rw-r--r-- | bitbake/lib/bb/shell.py | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py index b86dc9753c..93ad00d1ed 100644 --- a/bitbake/lib/bb/shell.py +++ b/bitbake/lib/bb/shell.py | |||
@@ -3,7 +3,8 @@ | |||
3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | 3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- |
4 | ########################################################################## | 4 | ########################################################################## |
5 | # | 5 | # |
6 | # Copyright (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>, Vanille Media | 6 | # Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de> |
7 | # Copyright (C) 2005-2006 Vanille Media | ||
7 | # | 8 | # |
8 | # This program is free software; you can redistribute it and/or modify it under | 9 | # This program is free software; you can redistribute it and/or modify it under |
9 | # the terms of the GNU General Public License as published by the Free Software | 10 | # the terms of the GNU General Public License as published by the Free Software |
@@ -59,7 +60,7 @@ import sys, os, imp, readline, socket, httplib, urllib, commands, popen2, copy, | |||
59 | imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" ) | 60 | imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" ) |
60 | from bb import data, parse, build, fatal | 61 | from bb import data, parse, build, fatal |
61 | 62 | ||
62 | __version__ = "0.5.3" | 63 | __version__ = "0.5.3.1" |
63 | __credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> | 64 | __credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
64 | Type 'help' for more information, press CTRL-D to exit.""" % __version__ | 65 | Type 'help' for more information, press CTRL-D to exit.""" % __version__ |
65 | 66 | ||
@@ -263,9 +264,10 @@ class BitBakeShellCommands: | |||
263 | bbfile = params[0] | 264 | bbfile = params[0] |
264 | print "SHELL: Parsing '%s'" % bbfile | 265 | print "SHELL: Parsing '%s'" % bbfile |
265 | parse.update_mtime( bbfile ) | 266 | parse.update_mtime( bbfile ) |
266 | bb_data, fromCache = cooker.load_bbfile( bbfile ) | 267 | cooker.bb_cache.cacheValidUpdate(bbfile) |
267 | cooker.pkgdata[bbfile] = bb_data | 268 | fromCache = cooker.bb_cache.loadData(bbfile, cooker) |
268 | if fromCache: | 269 | cooker.bb_cache.sync() |
270 | if False: #from Cache | ||
269 | print "SHELL: File has not been updated, not reparsing" | 271 | print "SHELL: File has not been updated, not reparsing" |
270 | else: | 272 | else: |
271 | print "SHELL: Parsed" | 273 | print "SHELL: Parsed" |
@@ -307,7 +309,7 @@ class BitBakeShellCommands: | |||
307 | what, globexpr = params | 309 | what, globexpr = params |
308 | if what == "files": | 310 | if what == "files": |
309 | self._checkParsed() | 311 | self._checkParsed() |
310 | for key in globfilter( cooker.pkgdata.keys(), globexpr ): print key | 312 | for key in globfilter( cooker.status.pkg_fn.keys(), globexpr ): print key |
311 | elif what == "providers": | 313 | elif what == "providers": |
312 | self._checkParsed() | 314 | self._checkParsed() |
313 | for key in globfilter( cooker.status.pkg_pn.keys(), globexpr ): print key | 315 | for key in globfilter( cooker.status.pkg_pn.keys(), globexpr ): print key |
@@ -374,7 +376,7 @@ SRC_URI = "" | |||
374 | pasteBin.usage = "<index>" | 376 | pasteBin.usage = "<index>" |
375 | 377 | ||
376 | def pasteLog( self, params ): | 378 | def pasteLog( self, params ): |
377 | """Send the last event exception error log (if there is one) to http://pastebin.com""" | 379 | """Send the last event exception error log (if there is one) to http://oe.pastebin.com""" |
378 | if last_exception is None: | 380 | if last_exception is None: |
379 | print "SHELL: No Errors yet (Phew)..." | 381 | print "SHELL: No Errors yet (Phew)..." |
380 | else: | 382 | else: |
@@ -432,7 +434,8 @@ SRC_URI = "" | |||
432 | name, var = params | 434 | name, var = params |
433 | bbfile = self._findProvider( name ) | 435 | bbfile = self._findProvider( name ) |
434 | if bbfile is not None: | 436 | if bbfile is not None: |
435 | value = cooker.pkgdata[bbfile].getVar( var, 1 ) | 437 | the_data = cooker.bb_cache.loadDataFull(bbfile, cooker) |
438 | value = the_data.getVar( var, 1 ) | ||
436 | print value | 439 | print value |
437 | else: | 440 | else: |
438 | print "ERROR: Nothing provides '%s'" % name | 441 | print "ERROR: Nothing provides '%s'" % name |
@@ -442,13 +445,14 @@ SRC_URI = "" | |||
442 | """Set contents of variable defined in providee's metadata""" | 445 | """Set contents of variable defined in providee's metadata""" |
443 | name, var, value = params | 446 | name, var, value = params |
444 | bbfile = self._findProvider( name ) | 447 | bbfile = self._findProvider( name ) |
445 | d = cooker.pkgdata[bbfile] | ||
446 | if bbfile is not None: | 448 | if bbfile is not None: |
447 | data.setVar( var, value, d ) | 449 | print "ERROR: Sorry, this functionality is currently broken" |
450 | #d = cooker.pkgdata[bbfile] | ||
451 | #data.setVar( var, value, d ) | ||
448 | 452 | ||
449 | # mark the change semi persistant | 453 | # mark the change semi persistant |
450 | cooker.pkgdata.setDirty(bbfile, d) | 454 | #cooker.pkgdata.setDirty(bbfile, d) |
451 | print "OK" | 455 | #print "OK" |
452 | else: | 456 | else: |
453 | print "ERROR: Nothing provides '%s'" % name | 457 | print "ERROR: Nothing provides '%s'" % name |
454 | poke.usage = "<providee> <variable> <value>" | 458 | poke.usage = "<providee> <variable> <value>" |
@@ -458,7 +462,7 @@ SRC_URI = "" | |||
458 | what = params[0] | 462 | what = params[0] |
459 | if what == "files": | 463 | if what == "files": |
460 | self._checkParsed() | 464 | self._checkParsed() |
461 | for key in cooker.pkgdata.keys(): print key | 465 | for key in cooker.status.pkg_fn.keys(): print key |
462 | elif what == "providers": | 466 | elif what == "providers": |
463 | self._checkParsed() | 467 | self._checkParsed() |
464 | for key in cooker.status.providers.keys(): print key | 468 | for key in cooker.status.providers.keys(): print key |
@@ -555,14 +559,14 @@ SRC_URI = "" | |||
555 | 559 | ||
556 | def completeFilePath( bbfile ): | 560 | def completeFilePath( bbfile ): |
557 | """Get the complete bbfile path""" | 561 | """Get the complete bbfile path""" |
558 | if not cooker.pkgdata: return bbfile | 562 | if not cooker.status.pkg_fn: return bbfile |
559 | for key in cooker.pkgdata.keys(): | 563 | for key in cooker.status.pkg_fn.keys(): |
560 | if key.endswith( bbfile ): | 564 | if key.endswith( bbfile ): |
561 | return key | 565 | return key |
562 | return bbfile | 566 | return bbfile |
563 | 567 | ||
564 | def sendToPastebin( content ): | 568 | def sendToPastebin( content ): |
565 | """Send content to http://www.pastebin.com""" | 569 | """Send content to http://oe.pastebin.com""" |
566 | mydata = {} | 570 | mydata = {} |
567 | mydata["parent_pid"] = "" | 571 | mydata["parent_pid"] = "" |
568 | mydata["format"] = "bash" | 572 | mydata["format"] = "bash" |
@@ -572,7 +576,7 @@ def sendToPastebin( content ): | |||
572 | params = urllib.urlencode( mydata ) | 576 | params = urllib.urlencode( mydata ) |
573 | headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"} | 577 | headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"} |
574 | 578 | ||
575 | conn = httplib.HTTPConnection( "pastebin.com:80" ) | 579 | conn = httplib.HTTPConnection( "oe.pastebin.com:80" ) |
576 | conn.request("POST", "/", params, headers ) | 580 | conn.request("POST", "/", params, headers ) |
577 | 581 | ||
578 | response = conn.getresponse() | 582 | response = conn.getresponse() |
@@ -594,10 +598,10 @@ def completer( text, state ): | |||
594 | if u == "<variable>": | 598 | if u == "<variable>": |
595 | allmatches = cooker.configuration.data.keys() | 599 | allmatches = cooker.configuration.data.keys() |
596 | elif u == "<bbfile>": | 600 | elif u == "<bbfile>": |
597 | if cooker.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] | 601 | if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] |
598 | else: allmatches = [ x.split("/")[-1] for x in cooker.pkgdata.keys() ] | 602 | else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn.keys() ] |
599 | elif u == "<providee>": | 603 | elif u == "<providee>": |
600 | if cooker.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] | 604 | if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ] |
601 | else: allmatches = cooker.status.providers.iterkeys() | 605 | else: allmatches = cooker.status.providers.iterkeys() |
602 | else: allmatches = [ "(No tab completion available for this command)" ] | 606 | else: allmatches = [ "(No tab completion available for this command)" ] |
603 | else: allmatches = [ "(No tab completion available for this command)" ] | 607 | else: allmatches = [ "(No tab completion available for this command)" ] |