diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-17 20:11:27 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-17 20:11:27 +0100 |
commit | 627d9b1bde25422ccde4e313ee3c954b5c9b2932 (patch) | |
tree | 3bdf252f71ed0a1155bef212fbf8c7415bdc2788 /bitbake-dev/lib/bb | |
parent | f1216d2adbb0371deedec3a5060f377e8eb65d64 (diff) | |
download | poky-627d9b1bde25422ccde4e313ee3c954b5c9b2932.tar.gz |
bitbake-dev: Sync with changes upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/lib/bb')
-rw-r--r-- | bitbake-dev/lib/bb/cache.py | 2 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/daemonize.py | 6 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/event.py | 7 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/fetch/__init__.py | 31 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/parse/parse_py/BBHandler.py | 8 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py | 7 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/shell.py | 5 | ||||
-rw-r--r-- | bitbake-dev/lib/bb/ui/knotty.py | 2 |
8 files changed, 46 insertions, 22 deletions
diff --git a/bitbake-dev/lib/bb/cache.py b/bitbake-dev/lib/bb/cache.py index e91967c032..d30d57d33b 100644 --- a/bitbake-dev/lib/bb/cache.py +++ b/bitbake-dev/lib/bb/cache.py | |||
@@ -273,7 +273,7 @@ class Cache: | |||
273 | for f,old_mtime in depends: | 273 | for f,old_mtime in depends: |
274 | fmtime = bb.parse.cached_mtime_noerror(f) | 274 | fmtime = bb.parse.cached_mtime_noerror(f) |
275 | # Check if file still exists | 275 | # Check if file still exists |
276 | if fmtime == 0: | 276 | if old_mtime != 0 and fmtime == 0: |
277 | self.remove(fn) | 277 | self.remove(fn) |
278 | return False | 278 | return False |
279 | 279 | ||
diff --git a/bitbake-dev/lib/bb/daemonize.py b/bitbake-dev/lib/bb/daemonize.py index 6023c9ccd2..1a8bb379f4 100644 --- a/bitbake-dev/lib/bb/daemonize.py +++ b/bitbake-dev/lib/bb/daemonize.py | |||
@@ -29,7 +29,8 @@ import sys # System-specific parameters and functions. | |||
29 | 29 | ||
30 | # Default daemon parameters. | 30 | # Default daemon parameters. |
31 | # File mode creation mask of the daemon. | 31 | # File mode creation mask of the daemon. |
32 | UMASK = 0 | 32 | # For BitBake's children, we do want to inherit the parent umask. |
33 | UMASK = None | ||
33 | 34 | ||
34 | # Default maximum for the number of available file descriptors. | 35 | # Default maximum for the number of available file descriptors. |
35 | MAXFD = 1024 | 36 | MAXFD = 1024 |
@@ -107,7 +108,8 @@ def createDaemon(function, logfile): | |||
107 | if (pid == 0): # The second child. | 108 | if (pid == 0): # The second child. |
108 | # We probably don't want the file mode creation mask inherited from | 109 | # We probably don't want the file mode creation mask inherited from |
109 | # the parent, so we give the child complete control over permissions. | 110 | # the parent, so we give the child complete control over permissions. |
110 | os.umask(UMASK) | 111 | if UMASK is not None: |
112 | os.umask(UMASK) | ||
111 | else: | 113 | else: |
112 | # Parent (the first child) of the second child. | 114 | # Parent (the first child) of the second child. |
113 | os._exit(0) | 115 | os._exit(0) |
diff --git a/bitbake-dev/lib/bb/event.py b/bitbake-dev/lib/bb/event.py index 8f0a1961df..86b566febf 100644 --- a/bitbake-dev/lib/bb/event.py +++ b/bitbake-dev/lib/bb/event.py | |||
@@ -125,6 +125,13 @@ def getName(e): | |||
125 | class ConfigParsed(Event): | 125 | class ConfigParsed(Event): |
126 | """Configuration Parsing Complete""" | 126 | """Configuration Parsing Complete""" |
127 | 127 | ||
128 | class RecipeParsed(Event): | ||
129 | """ Recipe Parsing Complete """ | ||
130 | |||
131 | def __init__(self, fn, d): | ||
132 | self.fn = fn | ||
133 | Event.__init__(self, d) | ||
134 | |||
128 | class StampUpdate(Event): | 135 | class StampUpdate(Event): |
129 | """Trigger for any adjustment of the stamp files to happen""" | 136 | """Trigger for any adjustment of the stamp files to happen""" |
130 | 137 | ||
diff --git a/bitbake-dev/lib/bb/fetch/__init__.py b/bitbake-dev/lib/bb/fetch/__init__.py index 2191c284e3..429822bfa9 100644 --- a/bitbake-dev/lib/bb/fetch/__init__.py +++ b/bitbake-dev/lib/bb/fetch/__init__.py | |||
@@ -485,21 +485,26 @@ class Fetch(object): | |||
485 | if pn: | 485 | if pn: |
486 | 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() | 486 | 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() |
487 | 487 | ||
488 | ld = d.createCopy() | ||
488 | for stash in src_tarball_stash: | 489 | for stash in src_tarball_stash: |
489 | fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True) | 490 | url = stash + tarfn |
490 | uri = stash + tarfn | 491 | try: |
491 | bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) | 492 | ud = FetchData(url, ld) |
492 | fetchcmd = fetchcmd.replace("${URI}", uri) | 493 | except bb.fetch.NoMethodError: |
493 | httpproxy = data.getVar("http_proxy", d, True) | 494 | bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url) |
494 | ftpproxy = data.getVar("ftp_proxy", d, True) | 495 | continue |
495 | if httpproxy: | 496 | |
496 | fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd | 497 | ud.setup_localpath(ld) |
497 | if ftpproxy: | 498 | |
498 | fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd | 499 | try: |
499 | ret = os.system(fetchcmd) | 500 | ud.method.go(url, ud, ld) |
500 | if ret == 0: | ||
501 | bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
502 | return True | 501 | return True |
502 | except (bb.fetch.MissingParameterError, | ||
503 | bb.fetch.FetchError, | ||
504 | bb.fetch.MD5SumError): | ||
505 | import sys | ||
506 | (type, value, traceback) = sys.exc_info() | ||
507 | bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value) | ||
503 | return False | 508 | return False |
504 | try_mirror = staticmethod(try_mirror) | 509 | try_mirror = staticmethod(try_mirror) |
505 | 510 | ||
diff --git a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py index f13bb015ba..76b917ca5d 100644 --- a/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake-dev/lib/bb/parse/parse_py/BBHandler.py | |||
@@ -114,6 +114,8 @@ def finalise(fn, d): | |||
114 | tasklist = data.getVar('__BBTASKS', d) or [] | 114 | tasklist = data.getVar('__BBTASKS', d) or [] |
115 | bb.build.add_tasks(tasklist, d) | 115 | bb.build.add_tasks(tasklist, d) |
116 | 116 | ||
117 | bb.event.fire(bb.event.RecipeParsed(fn, d)) | ||
118 | |||
117 | 119 | ||
118 | def handle(fn, d, include = 0): | 120 | def handle(fn, d, include = 0): |
119 | global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ | 121 | global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__ |
@@ -160,12 +162,6 @@ def handle(fn, d, include = 0): | |||
160 | f = open(fn,'r') | 162 | f = open(fn,'r') |
161 | abs_fn = fn | 163 | abs_fn = fn |
162 | 164 | ||
163 | if ext != ".bbclass": | ||
164 | dname = os.path.dirname(abs_fn) | ||
165 | if dname not in bbpath: | ||
166 | bbpath.insert(0, dname) | ||
167 | data.setVar('BBPATH', ":".join(bbpath), d) | ||
168 | |||
169 | if include: | 165 | if include: |
170 | bb.parse.mark_dependency(d, abs_fn) | 166 | bb.parse.mark_dependency(d, abs_fn) |
171 | 167 | ||
diff --git a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py index f8a49689e2..c9f1ea13fb 100644 --- a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -102,6 +102,13 @@ def include(oldfn, fn, data, error_out): | |||
102 | fn = bb.data.expand(fn, data) | 102 | fn = bb.data.expand(fn, data) |
103 | oldfn = bb.data.expand(oldfn, data) | 103 | oldfn = bb.data.expand(oldfn, data) |
104 | 104 | ||
105 | if not os.path.isabs(fn): | ||
106 | dname = os.path.dirname(oldfn) | ||
107 | bbpath = "%s:%s" % (dname, bb.data.getVar("BBPATH", data, 1)) | ||
108 | abs_fn = bb.which(bbpath, fn) | ||
109 | if abs_fn: | ||
110 | fn = abs_fn | ||
111 | |||
105 | from bb.parse import handle | 112 | from bb.parse import handle |
106 | try: | 113 | try: |
107 | ret = handle(fn, data, True) | 114 | ret = handle(fn, data, True) |
diff --git a/bitbake-dev/lib/bb/shell.py b/bitbake-dev/lib/bb/shell.py index 2ab855b644..66e51719a4 100644 --- a/bitbake-dev/lib/bb/shell.py +++ b/bitbake-dev/lib/bb/shell.py | |||
@@ -204,6 +204,11 @@ class BitBakeShellCommands: | |||
204 | self.build( params, "configure" ) | 204 | self.build( params, "configure" ) |
205 | configure.usage = "<providee>" | 205 | configure.usage = "<providee>" |
206 | 206 | ||
207 | def install( self, params ): | ||
208 | """Execute 'install' on a providee""" | ||
209 | self.build( params, "install" ) | ||
210 | install.usage = "<providee>" | ||
211 | |||
207 | def edit( self, params ): | 212 | def edit( self, params ): |
208 | """Call $EDITOR on a providee""" | 213 | """Call $EDITOR on a providee""" |
209 | name = params[0] | 214 | name = params[0] |
diff --git a/bitbake-dev/lib/bb/ui/knotty.py b/bitbake-dev/lib/bb/ui/knotty.py index 031fa71578..8a2afeeb6d 100644 --- a/bitbake-dev/lib/bb/ui/knotty.py +++ b/bitbake-dev/lib/bb/ui/knotty.py | |||
@@ -143,6 +143,8 @@ def init(server, eventHandler): | |||
143 | continue | 143 | continue |
144 | if event[0].startswith('bb.event.ConfigParsed'): | 144 | if event[0].startswith('bb.event.ConfigParsed'): |
145 | continue | 145 | continue |
146 | if event[0].startswith('bb.event.RecipeParsed'): | ||
147 | continue | ||
146 | print "Unknown Event: %s" % event | 148 | print "Unknown Event: %s" % event |
147 | 149 | ||
148 | except KeyboardInterrupt: | 150 | except KeyboardInterrupt: |