summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/path.py
Commit message (Collapse)AuthorAgeFilesLines
* lib/oe: drop custom implementation of oe.path.relativeRoss Burton2014-03-071-17/+1
| | | | | | | | | | | | | | As we now require Python 2.7 and os.path.relpath() was added in 2.6 we can now drop the reimplementation in oe.path. oe.path.relative is simple now a wrapper that changes the order of the arguments and it's use discouraged. (From OE-Core rev: 1a03cd16401d2926bba902ffc5df30911b5c9394) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path: Fixup handling of .* files in top level paths for ↵Richard Purdie2013-11-121-3/+1
| | | | | | | | | | | | copyhardlinktree() Files named .* in the top level of directories handled by this function were getting lost after the directory copying command was fixed. Rather than complicate the function further, use cpio instead. (From OE-Core rev: 59612905e9bb865762667aa7b3cb06e53c3a4071) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path: Fix performance issue got copyhardlinktree()Richard Purdie2013-11-121-1/+1
| | | | | | | | | | | | | | With the directory copy was added to avoid race issues, it wasn't noticed that tar was recursing the directories and copying files too. This is completely crazy when we hardlink those files in the next command. Resolve the issue by telling tar not to recurse. This gives a significant performance boost to various parts of the system (do_package for linux-yocto 256s -> 178s for example). (From OE-Core rev: 8b90ed084d59b4e07aa547255d327b25cfb2ee2b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path: Fix copytree functions for tar 1.27Richard Purdie2013-10-141-2/+2
| | | | | | | | | | | | | tar version 1.27 returns: tar: --same-order option cannot be used with -c with the commandlines we have been using. We can remove the -s option (which is --same-order) to remove the error. (From OE-Core rev: 69c26e795c117aabfaf313abbfd10e70ede633d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to use print as a function callRichard Purdie2013-05-091-1/+1
| | | | | | | | | In python 3 print is a function call. In some cases bb.note is a more appropriate call to make. (From OE-Core rev: 754874e68d1037c76fc4cc7d35d3fa12946d00f8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* clases/lib: Use modern exception syntaxRichard Purdie2013-05-091-3/+3
| | | | | | | | | Update older code to use modern exception handling syntax which is the form accepted by python 3. (From OE-Core rev: b010501cd089e649a68f683be0cf4d0aac90fbe3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* path.py: Deal with race issueRichard Purdie2013-05-031-7/+11
| | | | | | | | | | | | | | | | | The change to use copyhardlinktree in some of the sstate code instead of copytree exposed a race condition. This is due to cp failing if it finds a directory doesn't exist yet some other process creates it while cp was trying to create it itself. tar doesn't error in this case. To fix this we need to create the directory structure with tar, then use cp to hardlink the files. Messy but probably worth doing. I also took the opportunity to remove src_bak since the code is neater without it. (From OE-Core rev: 2f954a9a6932f1e6c564e7e7aacaac628a75eed7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: make hard links for staging filesRobert Yang2013-05-021-2/+7
| | | | | | | | | | | | | | | | | | | Make hard links for staging files instead of copy to save the disk space (3G will be saved for a core-image-sato build), and it doesn't affect much on the build time. The following directories are affected: 1) The sysroot 2) The DEPLOY_DIR 3) The pkgdata [YOCTO #4372] (From OE-Core rev: 5853e0f482b22258c909268fe71673a29e31989b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path.py: support missing directory components in realpath()Enrico Scholz2013-02-111-12/+14
| | | | | | | | | | Some use cases in OE operate on symlinks which dangling path components. Assume that these are directories instead of raising ENOENT. (From OE-Core rev: a96e2c84f24c15b77ee1fbc1f998b8b4796b8664) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib: implemented oe.path.realpath()Enrico Scholz2013-02-111-0/+87
| | | | | | | | | | | | | | | Various parts of the buildsystem have to work with symlinks. Resolving them is not trivial because they are always relative to a sysroot directory. Patch adds a function which returns the destination of a symlink by assuming a given path as the / toplevel directory. A testsuite was added too. (From OE-Core rev: 76e0bd7f8e3a3bd052a6e329f88e2d8099e899c4) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate/path.py: Add copyhardlinktree() function and use for performance ↵Richard Purdie2013-02-061-0/+8
| | | | | | | | | | | | optimisation Add a function which copys a tree as a set of hardlinks to the original files, then use this in sstate to reduce some of the overhead of sstate package creation since the file isn't actually copied. (From OE-Core rev: 8e373e69acac853213a62afb8bbdf0adc0c5045a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Remove a number of unneeded import os/bb callsRichard Purdie2012-07-191-2/+0
| | | | | | | | | | The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. (From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* path.py: add make_relative_symlink methodScott Garman2012-03-131-0/+27
| | | | | | | | | | This method allows you to convert an absolute symlink into a relative one. (From OE-Core rev: 71062c1e0fb45a4b4e58ea5d217706aa2b402d88) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie2012-03-051-1/+1
| | | | | | | | | | | | Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe.path: sync up with current OEChris Larson2011-03-231-7/+14
| | | | | | | (From OE-Core rev: 1958b303f98b8db5bab00344823bbb8e086b8dba) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path.py: Use bb.utils.mkdirhier instead of bb.mkdirhierKhem Raj2011-03-021-1/+1
| | | | | | | (From OE-Core rev: 5a22a8c06743b0a8a3d949288b99d53bd4b7ceb3) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path.py: Add expection class to handle the output argumentRichard Purdie2011-02-211-1/+8
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/path: Use check_output for subprocess so we can see error info. ↵Richard Purdie2011-02-181-10/+38
| | | | | | Import code to be python 2.6 compatible. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib.oe.path: Update copytree function to call shell commands since its twice ↵Richard Purdie2011-02-091-32/+12
| | | | | | | | as fast As an added bonus, hardlinks between files in the tree will be preserved too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/path: Use bb.utils.copyfile as shutils can't cope with copying ↵Richard Purdie2010-08-221-1/+1
| | | | | | unreadable files Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* lib/oe/path.py: Add copytree function that worksRichard Purdie2010-08-121-0/+41
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* lib/oe: support wildcards in path.removeJoshua Lock2010-08-121-8/+9
| | | | Signed-off-by: Joshua Lock <josh@linux.intel.com>
* lib/oe: sync with OE.devJoshua Lock2010-08-041-0/+22
| | | | | | | Most notable change is the move to creating symlinks to patches in the metadata tree rather than copying them. Signed-off-by: Joshua Lock <josh@linux.intel.com>
* lib/oe: Import oe lib from OE.devJoshua Lock2010-05-061-0/+44
This library moves the common Python methods into modules of an 'oe' Python package. Signed-off-by: Joshua Lock <josh@linux.intel.com>