diff options
| author | Richard Purdie <richard@openedhand.com> | 2008-09-30 20:46:17 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2008-09-30 20:46:17 +0000 |
| commit | 221ac2b25f544a500869667d8f95c6c12c80db1a (patch) | |
| tree | cb14f631faeb933c4dc0e52aee2c1b383bb2da4d | |
| parent | dc98b2c28c0a7a7ea715230a234bb846a18e4584 (diff) | |
| download | poky-221ac2b25f544a500869667d8f95c6c12c80db1a.tar.gz | |
bitbake/bitbake-dev: Sync with upstream
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5346 311d38ba-8fff-0310-9ca6-ca027cbcb966
| -rw-r--r-- | bitbake-dev/ChangeLog | 6 | ||||
| -rwxr-xr-x | bitbake-dev/bin/bbimage | 160 | ||||
| -rwxr-xr-x | bitbake-dev/bin/bitbake | 1 | ||||
| -rw-r--r-- | bitbake-dev/lib/bb/cooker.py | 4 | ||||
| -rw-r--r-- | bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py | 1 | ||||
| -rw-r--r-- | bitbake/ChangeLog | 2 | ||||
| -rwxr-xr-x | bitbake/bin/bitbake | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 1 | ||||
| -rw-r--r-- | bitbake/lib/bb/utils.py | 1 |
10 files changed, 20 insertions, 162 deletions
diff --git a/bitbake-dev/ChangeLog b/bitbake-dev/ChangeLog index 2ad0f713ff..83f602e494 100644 --- a/bitbake-dev/ChangeLog +++ b/bitbake-dev/ChangeLog | |||
| @@ -143,6 +143,12 @@ Changes in Bitbake 1.9.x: | |||
| 143 | - Revert the '-' character fix in class names since it breaks things | 143 | - Revert the '-' character fix in class names since it breaks things |
| 144 | - When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444) | 144 | - When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444) |
| 145 | - Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE. | 145 | - Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE. |
| 146 | - Move prunedir function to utils.py and add explode_dep_versions function | ||
| 147 | - Raise an exception if SRCREV == 'INVALID' | ||
| 148 | - Fix hg fetcher username/password handling and fix crash | ||
| 149 | - Fix PACKAGES_DYNAMIC handling of packages with '++' in the name | ||
| 150 | - Rename __depends to __base_depends after configuration parsing so we don't | ||
| 151 | recheck the validity of the config files time after time | ||
| 146 | 152 | ||
| 147 | Changes in Bitbake 1.8.0: | 153 | Changes in Bitbake 1.8.0: |
| 148 | - Release 1.7.x as a stable series | 154 | - Release 1.7.x as a stable series |
diff --git a/bitbake-dev/bin/bbimage b/bitbake-dev/bin/bbimage deleted file mode 100755 index 96b7dca323..0000000000 --- a/bitbake-dev/bin/bbimage +++ /dev/null | |||
| @@ -1,160 +0,0 @@ | |||
| 1 | #!/usr/bin/env python | ||
| 2 | # ex:ts=4:sw=4:sts=4:et | ||
| 3 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
| 4 | # | ||
| 5 | # Copyright (C) 2003 Chris Larson | ||
| 6 | # | ||
| 7 | # This program is free software; you can redistribute it and/or modify | ||
| 8 | # it under the terms of the GNU General Public License version 2 as | ||
| 9 | # published by the Free Software Foundation. | ||
| 10 | # | ||
| 11 | # This program is distributed in the hope that it will be useful, | ||
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | # GNU General Public License for more details. | ||
| 15 | # | ||
| 16 | # You should have received a copy of the GNU General Public License along | ||
| 17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 19 | |||
| 20 | import sys, os | ||
| 21 | sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | ||
| 22 | import bb | ||
| 23 | from bb import * | ||
| 24 | |||
| 25 | __version__ = 1.1 | ||
| 26 | type = "jffs2" | ||
| 27 | cfg_bb = data.init() | ||
| 28 | cfg_oespawn = data.init() | ||
| 29 | |||
| 30 | bb.msg.set_debug_level(0) | ||
| 31 | |||
| 32 | def usage(): | ||
| 33 | print "Usage: bbimage [options ...]" | ||
| 34 | print "Creates an image for a target device from a root filesystem," | ||
| 35 | print "obeying configuration parameters from the BitBake" | ||
| 36 | print "configuration files, thereby easing handling of deviceisms." | ||
| 37 | print "" | ||
| 38 | print " %s\t\t%s" % ("-r [arg], --root [arg]", "root directory (default=${IMAGE_ROOTFS})") | ||
| 39 | print " %s\t\t%s" % ("-t [arg], --type [arg]", "image type (jffs2[default], cramfs)") | ||
| 40 | print " %s\t\t%s" % ("-n [arg], --name [arg]", "image name (override IMAGE_NAME variable)") | ||
| 41 | print " %s\t\t%s" % ("-v, --version", "output version information and exit") | ||
| 42 | sys.exit(0) | ||
| 43 | |||
| 44 | def version(): | ||
| 45 | print "BitBake Build Tool Core version %s" % bb.__version__ | ||
| 46 | print "BBImage version %s" % __version__ | ||
| 47 | |||
| 48 | def emit_bb(d, base_d = {}): | ||
| 49 | for v in d.keys(): | ||
| 50 | if d[v] != base_d[v]: | ||
| 51 | data.emit_var(v, d) | ||
| 52 | |||
| 53 | def getopthash(l): | ||
| 54 | h = {} | ||
| 55 | for (opt, val) in l: | ||
| 56 | h[opt] = val | ||
| 57 | return h | ||
| 58 | |||
| 59 | import getopt | ||
| 60 | try: | ||
| 61 | (opts, args) = getopt.getopt(sys.argv[1:], 'vr:t:e:n:', [ 'version', 'root=', 'type=', 'bbfile=', 'name=' ]) | ||
| 62 | except getopt.GetoptError: | ||
| 63 | usage() | ||
| 64 | |||
| 65 | # handle opts | ||
| 66 | opthash = getopthash(opts) | ||
| 67 | |||
| 68 | if '--version' in opthash or '-v' in opthash: | ||
| 69 | version() | ||
| 70 | sys.exit(0) | ||
| 71 | |||
| 72 | try: | ||
| 73 | cfg_bb = parse.handle(os.path.join('conf', 'bitbake.conf'), cfg_bb) | ||
| 74 | except IOError: | ||
| 75 | fatal("Unable to open bitbake.conf") | ||
| 76 | |||
| 77 | # sanity check | ||
| 78 | if cfg_bb is None: | ||
| 79 | fatal("Unable to open/parse %s" % os.path.join('conf', 'bitbake.conf')) | ||
| 80 | usage(1) | ||
| 81 | |||
| 82 | # Handle any INHERITs and inherit the base class | ||
| 83 | inherits = ["base"] + (bb.data.getVar('INHERIT', cfg_bb, True ) or "").split() | ||
| 84 | for inherit in inherits: | ||
| 85 | cfg_bb = bb.parse.handle(os.path.join('classes', '%s.bbclass' % inherit), cfg_bb, True ) | ||
| 86 | |||
| 87 | rootfs = None | ||
| 88 | extra_files = [] | ||
| 89 | |||
| 90 | if '--root' in opthash: | ||
| 91 | rootfs = opthash['--root'] | ||
| 92 | if '-r' in opthash: | ||
| 93 | rootfs = opthash['-r'] | ||
| 94 | |||
| 95 | if '--type' in opthash: | ||
| 96 | type = opthash['--type'] | ||
| 97 | if '-t' in opthash: | ||
| 98 | type = opthash['-t'] | ||
| 99 | |||
| 100 | if '--bbfile' in opthash: | ||
| 101 | extra_files.append(opthash['--bbfile']) | ||
| 102 | if '-e' in opthash: | ||
| 103 | extra_files.append(opthash['-e']) | ||
| 104 | |||
| 105 | for f in extra_files: | ||
| 106 | try: | ||
| 107 | cfg_bb = parse.handle(f, cfg_bb) | ||
| 108 | except IOError: | ||
| 109 | print "unable to open %s" % f | ||
| 110 | |||
| 111 | if not rootfs: | ||
| 112 | rootfs = data.getVar('IMAGE_ROOTFS', cfg_bb, 1) | ||
| 113 | |||
| 114 | if not rootfs: | ||
| 115 | bb.fatal("IMAGE_ROOTFS not defined") | ||
| 116 | |||
| 117 | data.setVar('IMAGE_ROOTFS', rootfs, cfg_bb) | ||
| 118 | |||
| 119 | from copy import copy, deepcopy | ||
| 120 | localdata = data.createCopy(cfg_bb) | ||
| 121 | |||
| 122 | overrides = data.getVar('OVERRIDES', localdata) | ||
| 123 | if not overrides: | ||
| 124 | bb.fatal("OVERRIDES not defined.") | ||
| 125 | data.setVar('OVERRIDES', '%s:%s' % (overrides, type), localdata) | ||
| 126 | data.update_data(localdata) | ||
| 127 | data.setVar('OVERRIDES', overrides, localdata) | ||
| 128 | |||
| 129 | if '-n' in opthash: | ||
| 130 | data.setVar('IMAGE_NAME', opthash['-n'], localdata) | ||
| 131 | if '--name' in opthash: | ||
| 132 | data.setVar('IMAGE_NAME', opthash['--name'], localdata) | ||
| 133 | |||
| 134 | topdir = data.getVar('TOPDIR', localdata, 1) or os.getcwd() | ||
| 135 | |||
| 136 | cmd = data.getVar('IMAGE_CMD', localdata, 1) | ||
| 137 | if not cmd: | ||
| 138 | bb.fatal("IMAGE_CMD not defined") | ||
| 139 | |||
| 140 | outdir = data.getVar('DEPLOY_DIR_IMAGE', localdata, 1) | ||
| 141 | if not outdir: | ||
| 142 | bb.fatal('DEPLOY_DIR_IMAGE not defined') | ||
| 143 | mkdirhier(outdir) | ||
| 144 | |||
| 145 | #depends = data.getVar('IMAGE_DEPENDS', localdata, 1) or "" | ||
| 146 | #if depends: | ||
| 147 | # bb.note("Spawning bbmake to satisfy dependencies: %s" % depends) | ||
| 148 | # ret = os.system('bbmake %s' % depends) | ||
| 149 | # if ret != 0: | ||
| 150 | # bb.error("executing bbmake to satisfy dependencies") | ||
| 151 | |||
| 152 | bb.note("Executing %s" % cmd) | ||
| 153 | data.setVar('image_cmd', cmd, localdata) | ||
| 154 | data.setVarFlag('image_cmd', 'func', 1, localdata) | ||
| 155 | try: | ||
| 156 | bb.build.exec_func('image_cmd', localdata) | ||
| 157 | except bb.build.FuncFailed: | ||
| 158 | sys.exit(1) | ||
| 159 | #ret = os.system(cmd) | ||
| 160 | #sys.exit(ret) | ||
diff --git a/bitbake-dev/bin/bitbake b/bitbake-dev/bin/bitbake index 067cc274f9..c994edb84b 100755 --- a/bitbake-dev/bin/bitbake +++ b/bitbake-dev/bin/bitbake | |||
| @@ -140,6 +140,7 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
| 140 | 140 | ||
| 141 | 141 | ||
| 142 | cooker = bb.cooker.BBCooker(configuration) | 142 | cooker = bb.cooker.BBCooker(configuration) |
| 143 | cooker.parseConfiguration() | ||
| 143 | host = cooker.server.host | 144 | host = cooker.server.host |
| 144 | port = cooker.server.port | 145 | port = cooker.server.port |
| 145 | 146 | ||
diff --git a/bitbake-dev/lib/bb/cooker.py b/bitbake-dev/lib/bb/cooker.py index 8eb1a410f2..1531808613 100644 --- a/bitbake-dev/lib/bb/cooker.py +++ b/bitbake-dev/lib/bb/cooker.py | |||
| @@ -86,6 +86,10 @@ class BBCooker: | |||
| 86 | 86 | ||
| 87 | self.configuration.data = bb.data.init() | 87 | self.configuration.data = bb.data.init() |
| 88 | 88 | ||
| 89 | def parseConfiguration(self): | ||
| 90 | |||
| 91 | bb.data.inheritFromOS(self.configuration.data) | ||
| 92 | |||
| 89 | for f in self.configuration.file: | 93 | for f in self.configuration.file: |
| 90 | self.parseConfigurationFile( f ) | 94 | self.parseConfigurationFile( f ) |
| 91 | 95 | ||
diff --git a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py index e6488bbe11..f8a49689e2 100644 --- a/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake-dev/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -118,7 +118,6 @@ def handle(fn, data, include = 0): | |||
| 118 | init(data) | 118 | init(data) |
| 119 | 119 | ||
| 120 | if include == 0: | 120 | if include == 0: |
| 121 | bb.data.inheritFromOS(data) | ||
| 122 | oldfile = None | 121 | oldfile = None |
| 123 | else: | 122 | else: |
| 124 | oldfile = bb.data.getVar('FILE', data) | 123 | oldfile = bb.data.getVar('FILE', data) |
diff --git a/bitbake/ChangeLog b/bitbake/ChangeLog index c4aa5ba198..a2d0da29ea 100644 --- a/bitbake/ChangeLog +++ b/bitbake/ChangeLog | |||
| @@ -52,6 +52,8 @@ Changes in BitBake 1.8.x: | |||
| 52 | - Raise an exception if SRCREV == 'INVALID' | 52 | - Raise an exception if SRCREV == 'INVALID' |
| 53 | - Fix hg fetcher username/password handling and fix crash | 53 | - Fix hg fetcher username/password handling and fix crash |
| 54 | - Fix PACKAGES_DYNAMIC handling of packages with '++' in the name | 54 | - Fix PACKAGES_DYNAMIC handling of packages with '++' in the name |
| 55 | - Rename __depends to __base_depends after configuration parsing so we don't | ||
| 56 | recheck the validity of the config files time after time | ||
| 55 | 57 | ||
| 56 | Changes in BitBake 1.8.10: | 58 | Changes in BitBake 1.8.10: |
| 57 | - Psyco is available only for x86 - do not use it on other architectures. | 59 | - Psyco is available only for x86 - do not use it on other architectures. |
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 4492bf045b..e262d0b9b4 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
| @@ -113,6 +113,8 @@ Default BBFILES are the .bb files in the current directory.""" ) | |||
| 113 | 113 | ||
| 114 | cooker = bb.cooker.BBCooker(configuration) | 114 | cooker = bb.cooker.BBCooker(configuration) |
| 115 | 115 | ||
| 116 | cooker.parseConfiguration() | ||
| 117 | |||
| 116 | if configuration.profile: | 118 | if configuration.profile: |
| 117 | try: | 119 | try: |
| 118 | import cProfile as profile | 120 | import cProfile as profile |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8e6acb19fc..50624d8d33 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -59,6 +59,10 @@ class BBCooker: | |||
| 59 | 59 | ||
| 60 | self.configuration.data = bb.data.init() | 60 | self.configuration.data = bb.data.init() |
| 61 | 61 | ||
| 62 | def parseConfiguration(self): | ||
| 63 | |||
| 64 | bb.data.inheritFromOS(self.configuration.data) | ||
| 65 | |||
| 62 | for f in self.configuration.file: | 66 | for f in self.configuration.file: |
| 63 | self.parseConfigurationFile( f ) | 67 | self.parseConfigurationFile( f ) |
| 64 | 68 | ||
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index e6488bbe11..f8a49689e2 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -118,7 +118,6 @@ def handle(fn, data, include = 0): | |||
| 118 | init(data) | 118 | init(data) |
| 119 | 119 | ||
| 120 | if include == 0: | 120 | if include == 0: |
| 121 | bb.data.inheritFromOS(data) | ||
| 122 | oldfile = None | 121 | oldfile = None |
| 123 | else: | 122 | else: |
| 124 | oldfile = bb.data.getVar('FILE', data) | 123 | oldfile = bb.data.getVar('FILE', data) |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 211ac8129f..9c8d8e8435 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -305,3 +305,4 @@ def prunedir(topdir): | |||
| 305 | for name in dirs: | 305 | for name in dirs: |
| 306 | os.rmdir(os.path.join(root, name)) | 306 | os.rmdir(os.path.join(root, name)) |
| 307 | os.rmdir(topdir) | 307 | os.rmdir(topdir) |
| 308 | |||
