aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
AgeCommit message (Collapse)Author
2011-05-27bitbake/utils.py: Add option to lockfiles to return immediately rather than waitRichard Purdie
There are usecases where we don't want to block waiting for a lockfile so enhance the lockfile handling functions to support this. (Bitbake rev: 97e8adf03e5fab1fd40c3d53c48f7b333bc2e145) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31utils: fix typo in lockfileChris Larson
(Bitbake rev: 53a10b6793c5bdb45854483abe5da791058dfd84) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31lockfile: ask for forgiveness, not permissionChris Larson
Create the lockfile directory if it doesn't exist, rather than erroring out if it doesn't exist (was also racy). Also improve the wording of the error message shown when the lockfile's directory is not writable. Note for the future, this function should be improved, particularly with regard to its exception handling. It should be catching the *exact* exception(s) it will encounter when the file is locked, and continuing in that case only. If it did that, there'd be no need for the proactive directory writability check, as bb.utils.lockfile() would raise an appropriate IOError for that case. (Bitbake rev: 238151441c74db53d6e4d4753f4f96c32f6f13b6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-25bitbake/utils.py: Only try and add read access to a file if we don't have itRichard Purdie
A file we're copying might be on a readonly filesystem so if we can already read it, don't try and add read permission. Fixes BUGID #771 in Yocto. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-25bitbake/utils.py: Allow join_deps to return a list that isn't comman separatedRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-12fetch2: unpack revisionMark Hatle
Revise the unpack function to have a way to disable the unpack. This is based on the work from "Andreas Oberritter <obi@opendreambox.org>", see http://cgit.openembedded.net/cgit.cgi/openembedded/commit/?id=2bdfe8519eda8067845019a699acdf19a21ba380 In addition, the to_boolean function comes from the work of "Chris Larson <chris_larson@mentor.com>", see http://cgit.openembedded.net/cgit.cgi/openembedded/commit/?id=900cc29b603691eb3a077cb660545ead3715ed54 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2011-02-10Export KRB5CCNAME variableJavier Martin
This allows fetching git repositories using Kerberos authentication. (Bitbake rev: d761cf98284b02eb3d3a1f879782c501c284b698) Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08bitbake/utils.py: add glob name matching to removeSaul Wold
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-01-26bitbake/unlockfile: Fix exception handlingRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-24bitbake/utils: Ignore OSError in unlockfileRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-19bitbake/utils.py: Teach unlockfile about shared mode lockfilesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-19bitbake/utils.py: Add option of holding shared lockfilesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12*: use utils.remove() some moreBernhard Reutner-Fischer
(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10utils: show the actual exception in better_execChris Larson
(Bitbake rev: a148e6a63c842ac586ac1dddbd9008f93cdea297) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10bitbake/utils.py: Drop unused function extend_deps()Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10bitbake: Sync environment handling function names and comments with upstream ↵Richard Purdie
alterations Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-04bitbake: Sync a load of whitespace and other non-functionality changes with ↵Richard Purdie
bitbake uptream Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04utils: fix typo in error messageBernhard Reutner-Fischer
(Bitbake rev: 99cdb61b30d0c75c8f831c78346cc9f8ca7945dd) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04utils: don't overwrite builtin dir() functionBernhard Reutner-Fischer
(Bitbake rev: 6dc863f714beda6ca7ff8cd3e830a9bc8a39123d) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04utils: drop unnecessary debug msgs from mkdirhierChris Larson
(Bitbake rev: 4b36be445a05a544cd3a456acd1dcc8f962359e2) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04utils: fix 'lock' variable referenceChris Larson
(Bitbake rev: f57f8f3cc980e3ae1693c2e065227e951ed0b1c0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04utils: fix calls to close() in the lock/unlock functionsChris Larson
(Bitbake rev: 4262c26d36d1c1b6801ac422716a227c1f6b9589) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04build: use a contextmanager for locksChris Larson
Also don't bother passing logfile to exec_func_python, at least until we start adding the logfile as a file handler to the bitbake logger. (Bitbake rev: f99ee4680c9f67b7ed13fc06044ba2382f9a782c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04build: use bb.process instead of os.systemChris Larson
(Bitbake rev: 53740977521bc81ffa37adfa7bbeb8f2a80ea165) build: write logfiles per task, not per function Based on d14f9bf6 from poky, reworked for master and other cleanup. (Bitbake rev: beadff2eca1eb95f0411115dd72ddb4c3c44c604) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04vercmp: don't choke on empty first version componentsChris Larson
(Bitbake rev: e75aa94e9477933c5a40021b2a8e844db54f29da) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04Prefer xrange over range for small performance gain.Bob Foerster
range() allocates an actual list when called. xrange() is just an iterator and creates the next range item on demand. This provides a slight performance increase. In python 3, range will do what xrange does currently, but the upgrade will be handled by the 2to3 tool. (Bitbake rev: 73b40f06444cb877a5960b2aa66abf7dacbd88f0) Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04Don't show tracebacks for SystemExit or KeyboardInterruptChris Larson
(Bitbake rev: d71984b3934c3dd9791c3bc00f332b79a1985a05) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04Switch bitbake internals to use logging directly rather than bb.msgChris Larson
We use a custom Logger subclass for our loggers This logger provides: - 'debug' method which accepts a debug level - 'plain' method which bypasses log formatting - 'verbose' method which is more detail than info, but less than debug (Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04Use the python logging module under the hood for bb.msgChris Larson
(Bitbake rev: 47ca82397bc395b598c6b68b24cdee9e0d8a76d8) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04Make realfile optional for better_exec, using the existing fn in the code objectChris Larson
(Bitbake rev: 499a2d28d578cdd6df7cd30ccb79cc2b2796fb65) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-30bb.utils: check if lock file is writable, to fix bug 606Yu Ke
Bug 606 report that if $DL_DIR is read-only, do_fetch will simply hang without any error message. The root cause is that: bb.fetch.go()->bb.utils.lockfile() will try to lock file ${DL_DIR}/xxxxx.lock. Since ${DL_DIR} is read-only, it will cause IOError exception. Although lockfile() can catch the exception, currently code simply ignore all the exception and continue the loop. it make sense if the exception is caused by locking contention, but in the read-only $DL_DIR case, it cause endless waiting unfortunately. So this patch add read-only check for lockfile to avoid the silent hang. Fix [BUGID #606] Signed-off-by: Yu Ke <ke.yu@intel.com>
2010-12-09bitbake: Overhaul environment handlingRichard Purdie
Currently, anything whitelisted in the environment makes it into the worker processes. This is undesireable and the worker environment should be as clean as possible. This patch adapts bitbake sosme variables are loaded into bitbake's datastore but not exported by default. Any variable can be exported by setting its export flag. Currently, this code only finalises the environment in he worker as doing so in the server means variables are unavailable in the worker. If we switch back to fork() calls instead of exec() this code will need revisting. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-05bitbake/utils.py: Improve traceback to be more helpful/clear to usersRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-05bitbake/utils.py: Ensure the last lines of functions are printed in tracebacksRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03bitbake: Implement signaturesRichard Purdie
Includes functionality to find out what changes between two different singature data dumps. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-23utils.py: Fix bb.copyfile to change the permissions of the file back correctlyRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-20utils.py: Add a new extend_deps() to easily merge two dependency listsMark Hatle
Add a new extend_deps function to more easily merge two dependency lists. This avoids adding duplicates, unless the value of the dependency is different. Signed-off-by: Mark Hatle <mhatle@windriver.com>
2010-08-20bitbake/utils.py: Allow copyfile to copy files which aren't readableRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-20bitbake/utils.py: Improve better_exec debug outputRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19bitbake/utils.py: Give useful debug information when no lineno information ↵Richard Purdie
is available Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-17bitbake/utils.py: Allow explode_dep_versions to handle the commas join_deps ↵Richard Purdie
can introduce into strings Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-04*: Fix typo in documentationBernhard Reutner-Fischer
s/dictonary/dictionary/ (Bitbake rev: 0cc632761e75f66a8ce5ca2fe370f7551ccbfdf0) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-03utils: Fix number of arguments to bb.msg functionsBernhard Reutner-Fischer
the 'fn' argument of them is not used, should be removed anytime: sed -i -e '/^def.*fn/s/,[[:space:]]*fn[[:space:]]*=[[:space:]]*None[[:space:]]*)/)/g' lib/bb/msg.py (Bitbake rev: 1cb72e371322c271ee7f2d008c6f7899fb38b4fd) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Apply some 2to3 refactoringsChris Larson
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Kill unnecessary usages of the types moduleChris Larson
types.IntType -> int types.StringType -> basestring ... Also moves our ImmutableTypes tuple into our own namespace. (Bitbake rev: 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Apply some 2to3 transforms that don't cause issues in 2.6Chris Larson
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Apply the 2to3 print function transformChris Larson
(Bitbake rev: ff2e28d0d9723ccd0e9dd635447b6d889cc9f597) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Drop some unused varsChris Larson
(Bitbake rev: b79ca5f1cc2d262de877047769ce25279ba26672) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Import fixupsChris Larson
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02Formatting cleanupsChris Larson
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>