diff options
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 2c3275ac65..3c2469ef87 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -50,6 +50,61 @@ class ConfigParameters(object): | |||
50 | def parseEnvironment(self): | 50 | def parseEnvironment(self): |
51 | return os.environ.copy() | 51 | return os.environ.copy() |
52 | 52 | ||
53 | def updateFromServer(self, server): | ||
54 | if not self.options.cmd: | ||
55 | defaulttask, error = server.runCommand(["getVariable", "BB_DEFAULT_TASK"]) | ||
56 | if error: | ||
57 | raise Exception("Unable to get the value of BB_DEFAULT_TASK from the server: %s" % error) | ||
58 | self.options.cmd = defaulttask or "build" | ||
59 | _, error = server.runCommand(["setConfig", "cmd", self.options.cmd]) | ||
60 | if error: | ||
61 | raise Exception("Unable to set configuration option 'cmd' on the server: %s" % error) | ||
62 | |||
63 | if not self.options.pkgs_to_build: | ||
64 | bbpkgs, error = server.runCommand(["getVariable", "BBPKGS"]) | ||
65 | if error: | ||
66 | raise Exception("Unable to get the value of BBPKGS from the server: %s" % error) | ||
67 | if bbpkgs: | ||
68 | self.options.pkgs_to_build.extend(bbpkgs.split()) | ||
69 | |||
70 | def parseActions(self): | ||
71 | # Parse any commandline into actions | ||
72 | action = {'action':None, 'msg':None} | ||
73 | if self.options.show_environment: | ||
74 | if 'world' in self.options.pkgs_to_build: | ||
75 | action['msg'] = "'world' is not a valid target for --environment." | ||
76 | elif 'universe' in self.options.pkgs_to_build: | ||
77 | action['msg'] = "'universe' is not a valid target for --environment." | ||
78 | elif len(self.options.pkgs_to_build) > 1: | ||
79 | action['msg'] = "Only one target can be used with the --environment option." | ||
80 | elif self.options.buildfile and len(self.options.pkgs_to_build) > 0: | ||
81 | action['msg'] = "No target should be used with the --environment and --buildfile options." | ||
82 | elif len(self.options.pkgs_to_build) > 0: | ||
83 | action['action'] = ["showEnvironmentTarget", self.options.pkgs_to_build] | ||
84 | else: | ||
85 | action['action'] = ["showEnvironment", self.options.buildfile] | ||
86 | elif self.options.buildfile is not None: | ||
87 | action['action'] = ["buildFile", self.options.buildfile, self.options.cmd] | ||
88 | elif self.options.revisions_changed: | ||
89 | action['action'] = ["compareRevisions"] | ||
90 | elif self.options.show_versions: | ||
91 | action['action'] = ["showVersions"] | ||
92 | elif self.options.parse_only: | ||
93 | action['action'] = ["parseFiles"] | ||
94 | elif self.options.dot_graph: | ||
95 | if self.options.pkgs_to_build: | ||
96 | action['action'] = ["generateDotGraph", self.options.pkgs_to_build, self.options.cmd] | ||
97 | else: | ||
98 | action['msg'] = "Please specify a package name for dependency graph generation." | ||
99 | else: | ||
100 | if self.options.pkgs_to_build: | ||
101 | action['action'] = ["buildTargets", self.options.pkgs_to_build, self.options.cmd] | ||
102 | else: | ||
103 | #action['msg'] = "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information." | ||
104 | action = None | ||
105 | self.options.initialaction = action | ||
106 | return action | ||
107 | |||
53 | class CookerConfiguration(object): | 108 | class CookerConfiguration(object): |
54 | """ | 109 | """ |
55 | Manages build options and configurations for one run | 110 | Manages build options and configurations for one run |
@@ -61,7 +116,7 @@ class CookerConfiguration(object): | |||
61 | self.prefile = [] | 116 | self.prefile = [] |
62 | self.postfile = [] | 117 | self.postfile = [] |
63 | self.debug = 0 | 118 | self.debug = 0 |
64 | self.pkgs_to_build = [] | 119 | self.cmd = None |
65 | 120 | ||
66 | def setConfigParameters(self, parameters): | 121 | def setConfigParameters(self, parameters): |
67 | self.params = parameters | 122 | self.params = parameters |