diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 13:16:13 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2008-12-06 13:16:13 +0000 |
commit | ffdec425bfb26e152d1da5824a36dfe1fe72cd92 (patch) | |
tree | 38a5233e01e62d57964dbb0bf38ca88a92049386 /bitbake-dev/lib/bb | |
parent | 4be017e82fdfbfbe1bf484bf745e770d18417918 (diff) | |
download | poky-ffdec425bfb26e152d1da5824a36dfe1fe72cd92.tar.gz |
bitbake/bitbake-dev: Sync with upstream
Diffstat (limited to 'bitbake-dev/lib/bb')
-rw-r--r-- | bitbake-dev/lib/bb/cache.py | 6 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/cooker.py | 37 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/fetch/hg.py | 2 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/fetch/perforce.py | 24 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/fetch/svn.py | 4 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/taskdata.py | 15 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/utils.py | 1 |
7 files changed, 55 insertions, 34 deletions
diff --git a/bitbake-dev/lib/bb/cache.py b/bitbake-dev/lib/bb/cache.py index 1c87bfa12d..a4a4f47cef 100644 --- a/bitbake-dev/lib/bb/cache.py +++ b/bitbake-dev/lib/bb/cache.py | |||
@@ -95,7 +95,11 @@ class Cache: | |||
95 | bb.msg.note(1, bb.msg.domain.Cache, "Invalid cache found, rebuilding...") | 95 | bb.msg.note(1, bb.msg.domain.Cache, "Invalid cache found, rebuilding...") |
96 | self.depends_cache = {} | 96 | self.depends_cache = {} |
97 | else: | 97 | else: |
98 | bb.msg.note(1, bb.msg.domain.Cache, "Out of date cache found, rebuilding...") | 98 | try: |
99 | os.stat( self.cachefile ) | ||
100 | bb.msg.note(1, bb.msg.domain.Cache, "Out of date cache found, rebuilding...") | ||
101 | except OSError: | ||
102 | pass | ||
99 | 103 | ||
100 | def getVar(self, var, fn, exp = 0): | 104 | def getVar(self, var, fn, exp = 0): |
101 | """ | 105 | """ |
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py index 86229799f2..06f3395d7a 100644 --- a/bitbake-dev/lib/bb/cooker.py +++ b/bitbake-dev/lib/bb/cooker.py | |||
@@ -88,6 +88,24 @@ class BBCooker: | |||
88 | 88 | ||
89 | bb.data.inheritFromOS(self.configuration.data) | 89 | bb.data.inheritFromOS(self.configuration.data) |
90 | 90 | ||
91 | for f in self.configuration.file: | ||
92 | self.parseConfigurationFile( f ) | ||
93 | |||
94 | self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) ) | ||
95 | |||
96 | if not self.configuration.cmd: | ||
97 | self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build" | ||
98 | |||
99 | bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) | ||
100 | if bbpkgs: | ||
101 | self.configuration.pkgs_to_build.extend(bbpkgs.split()) | ||
102 | |||
103 | # | ||
104 | # Special updated configuration we use for firing events | ||
105 | # | ||
106 | self.configuration.event_data = bb.data.createCopy(self.configuration.data) | ||
107 | bb.data.update_data(self.configuration.event_data) | ||
108 | |||
91 | # TOSTOP must not be set or our children will hang when they output | 109 | # TOSTOP must not be set or our children will hang when they output |
92 | fd = sys.stdout.fileno() | 110 | fd = sys.stdout.fileno() |
93 | if os.isatty(fd): | 111 | if os.isatty(fd): |
@@ -105,23 +123,7 @@ class BBCooker: | |||
105 | self.server.register_idle_function(self.runCommands, self) | 123 | self.server.register_idle_function(self.runCommands, self) |
106 | 124 | ||
107 | def parseConfiguration(self): | 125 | def parseConfiguration(self): |
108 | # | ||
109 | # Special updated configuration we use for firing events | ||
110 | # | ||
111 | self.configuration.event_data = bb.data.createCopy(self.configuration.data) | ||
112 | bb.data.update_data(self.configuration.event_data) | ||
113 | |||
114 | for f in self.configuration.file: | ||
115 | self.parseConfigurationFile( f ) | ||
116 | 126 | ||
117 | self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) ) | ||
118 | |||
119 | if not self.configuration.cmd: | ||
120 | self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build" | ||
121 | |||
122 | bbpkgs = bb.data.getVar('BBPKGS', self.configuration.data, True) | ||
123 | if bbpkgs: | ||
124 | self.configuration.pkgs_to_build.extend(bbpkgs.split()) | ||
125 | 127 | ||
126 | # Change nice level if we're asked to | 128 | # Change nice level if we're asked to |
127 | nice = bb.data.getVar("BB_NICE_LEVEL", self.configuration.data, True) | 129 | nice = bb.data.getVar("BB_NICE_LEVEL", self.configuration.data, True) |
@@ -149,6 +151,9 @@ class BBCooker: | |||
149 | self.commandlineAction = ["showVersions"] | 151 | self.commandlineAction = ["showVersions"] |
150 | elif self.configuration.parse_only: | 152 | elif self.configuration.parse_only: |
151 | self.commandlineAction = ["parseFiles"] | 153 | self.commandlineAction = ["parseFiles"] |
154 | # FIXME - implement | ||
155 | #elif self.configuration.interactive: | ||
156 | # self.interactiveMode() | ||
152 | elif self.configuration.dot_graph: | 157 | elif self.configuration.dot_graph: |
153 | if self.configuration.pkgs_to_build: | 158 | if self.configuration.pkgs_to_build: |
154 | self.commandlineAction = ["generateDotGraph", self.configuration.pkgs_to_build, self.configuration.cmd] | 159 | self.commandlineAction = ["generateDotGraph", self.configuration.pkgs_to_build, self.configuration.cmd] |
diff --git a/bitbake-dev/lib/bb/fetch/hg.py b/bitbake-dev/lib/bb/fetch/hg.py index 1cd5a8aa5c..b87fd0fbe5 100644 --- a/bitbake-dev/lib/bb/fetch/hg.py +++ b/bitbake-dev/lib/bb/fetch/hg.py | |||
@@ -79,7 +79,7 @@ class Hg(Fetch): | |||
79 | host = "/" | 79 | host = "/" |
80 | ud.host = "localhost" | 80 | ud.host = "localhost" |
81 | 81 | ||
82 | if ud.user == None: | 82 | if not ud.user: |
83 | hgroot = host + ud.path | 83 | hgroot = host + ud.path |
84 | else: | 84 | else: |
85 | hgroot = ud.user + "@" + host + ud.path | 85 | hgroot = ud.user + "@" + host + ud.path |
diff --git a/bitbake-dev/lib/bb/fetch/perforce.py b/bitbake-dev/lib/bb/fetch/perforce.py index b594d2bde2..2fb38b4190 100644 --- a/bitbake-dev/lib/bb/fetch/perforce.py +++ b/bitbake-dev/lib/bb/fetch/perforce.py | |||
@@ -67,14 +67,15 @@ class Perforce(Fetch): | |||
67 | doparse = staticmethod(doparse) | 67 | doparse = staticmethod(doparse) |
68 | 68 | ||
69 | def getcset(d, depot,host,user,pswd,parm): | 69 | def getcset(d, depot,host,user,pswd,parm): |
70 | p4opt = "" | ||
70 | if "cset" in parm: | 71 | if "cset" in parm: |
71 | return parm["cset"]; | 72 | return parm["cset"]; |
72 | if user: | 73 | if user: |
73 | data.setVar('P4USER', user, d) | 74 | p4opt += " -u %s" % (user) |
74 | if pswd: | 75 | if pswd: |
75 | data.setVar('P4PASSWD', pswd, d) | 76 | p4opt += " -P %s" % (pswd) |
76 | if host: | 77 | if host: |
77 | data.setVar('P4PORT', host, d) | 78 | p4opt += " -p %s" % (host) |
78 | 79 | ||
79 | p4date = data.getVar("P4DATE", d, 1) | 80 | p4date = data.getVar("P4DATE", d, 1) |
80 | if "revision" in parm: | 81 | if "revision" in parm: |
@@ -85,8 +86,8 @@ class Perforce(Fetch): | |||
85 | depot += "@%s" % (p4date) | 86 | depot += "@%s" % (p4date) |
86 | 87 | ||
87 | p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1) | 88 | p4cmd = data.getVar('FETCHCOMMAND_p4', d, 1) |
88 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s changes -m 1 %s" % (p4cmd, depot)) | 89 | bb.msg.debug(1, bb.msg.domain.Fetcher, "Running %s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) |
89 | p4file = os.popen("%s changes -m 1 %s" % (p4cmd,depot)) | 90 | p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) |
90 | cset = p4file.readline().strip() | 91 | cset = p4file.readline().strip() |
91 | bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset)) | 92 | bb.msg.debug(1, bb.msg.domain.Fetcher, "READ %s" % (cset)) |
92 | if not cset: | 93 | if not cset: |
@@ -146,14 +147,15 @@ class Perforce(Fetch): | |||
146 | data.update_data(localdata) | 147 | data.update_data(localdata) |
147 | 148 | ||
148 | # Get the p4 command | 149 | # Get the p4 command |
150 | p4opt = "" | ||
149 | if user: | 151 | if user: |
150 | data.setVar('P4USER', user, localdata) | 152 | p4opt += " -u %s" % (user) |
151 | 153 | ||
152 | if pswd: | 154 | if pswd: |
153 | data.setVar('P4PASSWD', pswd, localdata) | 155 | p4opt += " -P %s" % (pswd) |
154 | 156 | ||
155 | if host: | 157 | if host: |
156 | data.setVar('P4PORT', host, localdata) | 158 | p4opt += " -p %s" % (host) |
157 | 159 | ||
158 | p4cmd = data.getVar('FETCHCOMMAND', localdata, 1) | 160 | p4cmd = data.getVar('FETCHCOMMAND', localdata, 1) |
159 | 161 | ||
@@ -175,8 +177,8 @@ class Perforce(Fetch): | |||
175 | 177 | ||
176 | os.chdir(tmpfile) | 178 | os.chdir(tmpfile) |
177 | bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc) | 179 | bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc) |
178 | bb.msg.note(1, bb.msg.domain.Fetcher, "%s files %s" % (p4cmd, depot)) | 180 | bb.msg.note(1, bb.msg.domain.Fetcher, "%s%s files %s" % (p4cmd, p4opt, depot)) |
179 | p4file = os.popen("%s files %s" % (p4cmd, depot)) | 181 | p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot)) |
180 | 182 | ||
181 | if not p4file: | 183 | if not p4file: |
182 | bb.error("Fetch: unable to get the P4 files from %s" % (depot)) | 184 | bb.error("Fetch: unable to get the P4 files from %s" % (depot)) |
@@ -193,7 +195,7 @@ class Perforce(Fetch): | |||
193 | dest = list[0][len(path)+1:] | 195 | dest = list[0][len(path)+1:] |
194 | where = dest.find("#") | 196 | where = dest.find("#") |
195 | 197 | ||
196 | os.system("%s print -o %s/%s %s" % (p4cmd, module,dest[:where],list[0])) | 198 | os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module,dest[:where],list[0])) |
197 | count = count + 1 | 199 | count = count + 1 |
198 | 200 | ||
199 | if count == 0: | 201 | if count == 0: |
diff --git a/bitbake-dev/lib/bb/fetch/svn.py b/bitbake-dev/lib/bb/fetch/svn.py index 5e5b31b3ad..aead1629b3 100644 --- a/bitbake-dev/lib/bb/fetch/svn.py +++ b/bitbake-dev/lib/bb/fetch/svn.py | |||
@@ -114,13 +114,15 @@ class Svn(Fetch): | |||
114 | if command is "info": | 114 | if command is "info": |
115 | svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module) | 115 | svncmd = "%s info %s %s://%s/%s/" % (basecmd, " ".join(options), proto, svnroot, ud.module) |
116 | else: | 116 | else: |
117 | suffix = "" | ||
117 | if ud.revision: | 118 | if ud.revision: |
118 | options.append("-r %s" % ud.revision) | 119 | options.append("-r %s" % ud.revision) |
120 | suffix = "@%s" % (ud.revision) | ||
119 | elif ud.date: | 121 | elif ud.date: |
120 | options.append("-r {%s}" % ud.date) | 122 | options.append("-r {%s}" % ud.date) |
121 | 123 | ||
122 | if command is "fetch": | 124 | if command is "fetch": |
123 | svncmd = "%s co %s %s://%s/%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, ud.module) | 125 | svncmd = "%s co %s %s://%s/%s%s %s" % (basecmd, " ".join(options), proto, svnroot, ud.module, suffix, ud.module) |
124 | elif command is "update": | 126 | elif command is "update": |
125 | svncmd = "%s update %s" % (basecmd, " ".join(options)) | 127 | svncmd = "%s update %s" % (basecmd, " ".join(options)) |
126 | else: | 128 | else: |
diff --git a/bitbake-dev/lib/bb/taskdata.py b/bitbake-dev/lib/bb/taskdata.py index 782dfb0b78..64ab032c3c 100644 --- a/bitbake-dev/lib/bb/taskdata.py +++ b/bitbake-dev/lib/bb/taskdata.py | |||
@@ -340,7 +340,10 @@ class TaskData: | |||
340 | self.add_provider_internal(cfgData, dataCache, item) | 340 | self.add_provider_internal(cfgData, dataCache, item) |
341 | except bb.providers.NoProvider: | 341 | except bb.providers.NoProvider: |
342 | if self.abort: | 342 | if self.abort: |
343 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item))) | 343 | if self.get_rdependees_str(item): |
344 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item))) | ||
345 | else: | ||
346 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item)) | ||
344 | raise | 347 | raise |
345 | targetid = self.getbuild_id(item) | 348 | targetid = self.getbuild_id(item) |
346 | self.remove_buildtarget(targetid) | 349 | self.remove_buildtarget(targetid) |
@@ -358,7 +361,10 @@ class TaskData: | |||
358 | return | 361 | return |
359 | 362 | ||
360 | if not item in dataCache.providers: | 363 | if not item in dataCache.providers: |
361 | bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item))) | 364 | if self.get_rdependees_str(item): |
365 | bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (item, self.get_dependees_str(item))) | ||
366 | else: | ||
367 | bb.msg.note(2, bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (item)) | ||
362 | bb.event.fire(bb.event.NoProvider(item, cfgData)) | 368 | bb.event.fire(bb.event.NoProvider(item, cfgData)) |
363 | raise bb.providers.NoProvider(item) | 369 | raise bb.providers.NoProvider(item) |
364 | 370 | ||
@@ -536,7 +542,10 @@ class TaskData: | |||
536 | except bb.providers.NoProvider: | 542 | except bb.providers.NoProvider: |
537 | targetid = self.getbuild_id(target) | 543 | targetid = self.getbuild_id(target) |
538 | if self.abort and targetid in self.external_targets: | 544 | if self.abort and targetid in self.external_targets: |
539 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (target, self.get_dependees_str(target))) | 545 | if self.get_rdependees_str(target): |
546 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s' (but '%s' DEPENDS on or otherwise requires it)" % (target, self.get_dependees_str(target))) | ||
547 | else: | ||
548 | bb.msg.error(bb.msg.domain.Provider, "Nothing PROVIDES '%s'" % (target)) | ||
540 | raise | 549 | raise |
541 | self.remove_buildtarget(targetid) | 550 | self.remove_buildtarget(targetid) |
542 | for target in self.get_unresolved_run_targets(dataCache): | 551 | for target in self.get_unresolved_run_targets(dataCache): |
diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 33a0c17650..90ba9ac2e0 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py | |||
@@ -323,7 +323,6 @@ def preserved_envvars_list(): | |||
323 | 'HOME', | 323 | 'HOME', |
324 | 'LANG', | 324 | 'LANG', |
325 | 'LOGNAME', | 325 | 'LOGNAME', |
326 | 'OEROOT', | ||
327 | 'PATH', | 326 | 'PATH', |
328 | 'PWD', | 327 | 'PWD', |
329 | 'SESSION_MANAGER', | 328 | 'SESSION_MANAGER', |