aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2011-02-18utils.py: use bb.utils.vercmp_string instead of bb.vercmpAndreas Oberritter
* Fixes deprecation warning with BitBake master. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> CC: Chris Larson <chris_larson@mentor.com> Signed-off-by: Tom Rini <tom_rini@mentor.com>
2011-02-09oe.test_types: improve naming/organizationChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-09More sane naming for the variable typing codeChris Larson
oe.types.value -> oe.data.typed_value This name has been bugging me. This function is the primary interface to the module for OE metadata, as it takes a variable name and datastore and returns an object of the correct type. While this function is part of the variable typing implementation, in reality it's more about giving you a useful object from the metadata, so I think oe.data is a more appropriate place for it. oe.types -> oe.maketype These are the functions which construct types, not the types themselves, so it was somewhat misleading. oe._types -> oe.types These are the actual types, any callable in this module becomes an OE type, using its arguments to determine the variable flags (optional and required) to obey. Will use __init__'s args in the case of an actual python class. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-09oe.types: for invalid type, list valid onesChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-15unpack.py: add SRC_URI parameter unpack=<bool> (default: true)Andreas Oberritter
* This allows to download compressed files without extracting them * Use case: gcj requires ecj.jar, which must be downloaded separately and put into the gcc source directory before configure gets executed. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> CC: Chris Larson <chris_larson@mentor.com> Reviewed-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-01-13oe.types: add floating point typeChris Larson
Optional flags: 'fromhex': if set to a true value (obeying the same rules as for the boolean type), your string value is in base 16, not base 10 Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-13oe.types: allow specifying the number base for integerChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-13oe.types: add/update docstringsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-28Implement variable typingChris Larson
This implementation consists of two components: - oe.types python module, whose job it is to construct objects of the defined type for a given variable in the metadata - typecheck.bbclass, which iterates over all configuration variables with a type defined and uses oe.types to check the validity of the values This gives us a few benefits: - Automatic sanity checking of all configuration variables with a defined type - Avoid duplicating the "how do I make use of the value of this variable" logic between its users. For variables like PATH, this is simply a split(), for boolean variables, the duplication can result in confusing, or even mismatched semantics (is this 0/1, empty/nonempty, what?) - Make it easier to create a configuration UI, as the type information could be used to provide a better interface than a text edit box (e.g checkbox for 'boolean', dropdown for 'choice') This functionality is entirely opt-in right now. To enable the configuration variable type checking, simply INHERIT += "typecheck". Example of a failing type check: BAZ = "foo" BAZ[type] = "boolean" $ bitbake -p FATAL: BAZ: Invalid boolean value 'foo' $ Examples of leveraging oe.types in a python snippet: PACKAGES[type] = "list" python () { import oe.types for pkg in oe.types.value("PACKAGES", d): bb.note("package: %s" % pkg) } LIBTOOL_HAS_SYSROOT = "yes" LIBTOOL_HAS_SYSROOT[type] = "boolean" python () { import oe.types assert(oe.types.value("LIBTOOL_HAS_SYSROOT", d) == True) } Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-17oe.patch: add missing bb importsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-15oe.utils: add 'inherits' functionChris Larson
This is simply a more convenient form of bb.data.inherits_class, as it can accept any number of classes, and will return True if it inherits any of them. This is similar to how isinstance() behaves. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-08oe.patch: for 'patch', always use -fChris Larson
Apparently quilt always ignores hunks that seem already applied, so let's do the same via -f. -t would probably be better, but isn't safe to use from a portability standpoint. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-26Handle .lz/.tar.lz URIsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-23oe.patch: fall back to '-' for quiltrcChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-23oe.patch: use --quiltrc= instead of --quiltrcChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-21oe.patch: don't use dry-run for 'patch'Chris Larson
There are patches which 'patch' thinks it can't apply, but which do apply, so stop using dry-run. In addition, --dry-run isn't compatible with all versions of patch. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-21oe.patch: use oe.processChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-21oe.process: allow passing input into run()Chris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-21oe.patch: fix 'd' referencesChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-16utils, oe.utils: add 'uniq' functionChris Larson
Ignore duplicates in an iterable. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-15oe.unpack: fix subdir-featureHenning Heinold
2010-10-13oe.unpack: use oe.processChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-13oe.process: subclass PopenChris Larson
Rather than providing a wrapper function, we can subclass Popen and provide our slightly different defaults that way. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-13oe.process: pull some common bits overChris Larson
Also update gitver to use the subprocess wrappers Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-10oe.packagegroup: fix python version compat issueChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-09Implement 'dbg', 'dev', and 'doc' package groupsChris Larson
These allow one to include debugging, development, and documentation files for all packages installed in the image, via IMAGE_FEATURES. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-09Move packagedata code into oe.packagedataChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-09oe.packagegroup: add code for package groupsChris Larson
This includes some utility functions for dealing with groups of packages defined in the metadata. Metadata syntax: PACKAGE_GROUP_<group> = "<list of packages>" If the packages in the group are optional: PACKAGE_GROUP_<group>[optional] = "1" Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-09oe.package: add 'files' functionChris Larson
This function obtains a list of files to be included in a package, using the globs in FILES_<pkg> and the files installed in ${D}. Currently, the only user is package_dbg, but I can see this being useful in package.bbclass as well. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-10-09oe.path: add 'find' convenience functionChris Larson
find is simply an os.walk in generator form, yielding the absolute path to each file. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-27oe.path: added 'recurse' argument to remove()Enrico Scholz
This makes it possible to specify whether the equivalent of 'rm -rf' or only this of 'rm -f' is wanted. Due to backward compatibility it defaults to the recursive variant. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Acked-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-09-23oe/patch.py: Remove series file during Clean()Khem Raj
Currently if there is a failed do_patch the series files get appended so if there were two patches a.patch b.patch and b.patch failed during next run it would append a.patch again a.patch b.patch a.patch and this would keep growing. We can remove series file in Clean() because we populate it in Import() anyway Signed-off-by: Khem Raj <raj.khem@gmail.com> Acked-by: Chris Larson <chris_larson@mentor.com> Acked-by: Eric Bénard <eric@eukrea.com>
2010-09-06lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xzEric Bénard
* Actually, the uncompressed file is written into the source path instead of the destination path. * By also removing the source path, this patch should fix this problem. * An other fix could be to not uncompress to stdout but let gunzip|bunzip2| xz uncompress directly to the file. Signed-off-by: Eric Bénard <eric@eukrea.com> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Acked-by: Chris Larson <chris_larson@mentor.com>
2010-09-02do_unpack, do_patch: shift some responsibility around, clean things upChris Larson
- Consolidate 'is this file a patch' logic - Move unpack functions from classes into oe.unpack - Move the unpacking message printing into do_unpack - Move the destination directory determination into do_unpack - Use subprocess's ability to pass in PATH and cwd rather than mangling the cmd - Use shutil.copy2/copytree for ordinary file "unpack" - Use the existing urldata from bb.fetch.init rather than re-decodeurl'ing the urls - Make handling of globs in url paths explicit rather than implicit, calling oe_unpack on each one, so showing an unpacking message to the user for each globbed file, rather than the entirety Signed-off-by: Chris Larson <chris_larson@mentor.com> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Tom Rini <tom_rini@mentor.com>
2010-07-26oe.patch: don't error when the symlink already exists and is correctEvgeniy Dushistov
Adds oe.path.symlink convenience function. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-06-10lib/oe/patch.py: Dont import patches but symlink them insteadKhem Raj
* This patch removes the usage of quilt import <patch> instead it creasted a symlink to the patch in the patches directory and synthesizes the series file which otherwise would be done automatically by quilt import. * This should help a bit in reducing build time as it avoids copying of the patch and also other things that quilt import would otherwise do. * Tested by doing minimal-image on qemuarm. Signed-off-by: Khem Raj <raj.khem@gmail.com> Acked-by: Chris Larson <chris_larson@mentor.com> Acked-by: Roman I Khimov <khimov@altell.ru>
2010-06-10Add a rm -rf utility function and use it in packaged-staging.bbclassChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-06-09Revert "lib/oe/patch.py: Dont import patches but symlink them instead"Khem Raj
pushed wrong branch. It needs to be reviewed before pushing. This reverts commit 428c2de6d27dd49274b9884c3123b053c42af0ce.
2010-06-09lib/oe/patch.py: Dont import patches but symlink them insteadKhem Raj
* This patch removes the usage of quilt import <patch> instead it creasted a symlink to the patch in the patches directory and synthesizes the series file which otherwise would be done automatically by quilt import. * This should help a bit in reducing build time as it avoids copying of the patch and also other things that quilt import would otherwise do. * Tested by doing minimal-image on qemuarm. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-05-27oe.utils: added param_bool() methodEnrico Scholz
This new function works like dict's get() method but converts the returned value to a boolean. It is to be used to interpret e.g. 'apply=yes' parameters in SRC_URI. Moved from base.bbclass into lib/oe/utils.py -kergoth Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-05-23oe.patch: kill long standing annoying messages from the non-quilt patch ↵Chris Larson
application Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-24oe.path.relative: add missing importsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-24Revert "oe.path.relative: switch to a different appraoch"Chris Larson
Drop this for now, seems to cause issues with python 2.5. This reverts commit 5c923fd35c369bae929fc0e110121abeaffab493.
2010-04-23oe.path.relative: switch to a different appraochChris Larson
Signed-off-by: Chris Larson <clarson@kergoth.com>
2010-04-23oe.path.relative: leverage os.path.relpath if availableChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-23oe.path.join: simplify a bitChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-23Initial move of common python bits into modules of the 'oe' python packageChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>