diff options
author | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-07-06 15:42:10 +0000 |
---|---|---|
committer | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-07-06 15:42:10 +0000 |
commit | b8046ac57a466d24fca1f8a998ab82e195e4dbfd (patch) | |
tree | 31556b3a03b93ff834a1aacb27a86a6a56277ade | |
parent | 82b3c9a47b8729ea2b93d3fda0f792ee4da43ad9 (diff) | |
download | bitbake-b8046ac57a466d24fca1f8a998ab82e195e4dbfd.tar.gz |
Shell: grab a deepcopy from the initial cooker data to reuse
it in file**** commands. Otherwise we would pollute
cooker.configuration.data (i.e. do_configure_append() appending
multiple times). This fixes BitBake bug #133
-rw-r--r-- | lib/bb/shell.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/bb/shell.py b/lib/bb/shell.py index 8c157793d..9a6c66fda 100644 --- a/lib/bb/shell.py +++ b/lib/bb/shell.py @@ -53,7 +53,7 @@ try: set except NameError: from sets import Set as set -import sys, os, imp, readline, socket, httplib, urllib, commands, popen2 +import sys, os, imp, readline, socket, httplib, urllib, commands, popen2, copy imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" ) from bb import data, parse, build, fatal @@ -66,6 +66,7 @@ leave_mainloop = False last_exception = None cooker = None parsed = False +initdata = None debug = os.environ.get( "BBSHELL_DEBUG", "" ) ########################################################################## @@ -211,8 +212,13 @@ class BitBakeShellCommands: cooker.build_cache = [] cooker.build_cache_fail = [] + thisdata = copy.deepcopy( initdata ) + # Caution: parse.handle modifies thisdata, hence it would + # lead to pollution cooker.configuration.data, which is + # why we use it on a safe copy we obtained from cooker right after + # parsing the initial *.conf files try: - bbfile_data = parse.handle( bf, cooker.configuration.data ) + bbfile_data = parse.handle( bf, thisdata ) except parse.ParseError: print "ERROR: Unable to open or parse '%s'" % bf else: @@ -649,6 +655,10 @@ class BitBakeShell: print __credits__ + # save initial cooker configuration (will be reused in file*** commands) + global initdata + initdata = copy.deepcopy( cooker.configuration.data ) + def cleanup( self ): """Write readline history and clean up resources""" debugOut( "writing command history" ) |