diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-24 10:17:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-25 17:19:18 +0100 |
commit | ded3fc6b56fe2612d565d7d812316276cf6beefe (patch) | |
tree | 1c3abbf3f53c998566237d0a1d9b2051756baf5b /meta | |
parent | 3be0213c807d27dbb1bcc7eaef55120232fda508 (diff) | |
download | poky-ded3fc6b56fe2612d565d7d812316276cf6beefe.tar.gz |
utils: Add hardlinkdir shell function
In a number of places it would be helpful to be able to copy trees of
files using hardlinks. This turns out to be harder than you'd expect
since there is no good single command that does this well and handles
all file types correctly.
Abstracting this into a function therefore makes sense, cpio seems
as good an option as any other.
(From OE-Core rev: 14ef03182e1e5fe7cf6b4112f29e6609631aa78d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/utils.bbclass | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 0a533afb1f..89ad8c5531 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass | |||
@@ -292,6 +292,15 @@ END | |||
292 | chmod +x $cmd | 292 | chmod +x $cmd |
293 | } | 293 | } |
294 | 294 | ||
295 | # Copy files/directories from $1 to $2 but using hardlinks | ||
296 | # (preserve symlinks) | ||
297 | hardlinkdir () { | ||
298 | from=$1 | ||
299 | to=$2 | ||
300 | (cd $from; find . -print0 | cpio --null -pdlu $to) | ||
301 | } | ||
302 | |||
303 | |||
295 | def check_app_exists(app, d): | 304 | def check_app_exists(app, d): |
296 | app = d.expand(app) | 305 | app = d.expand(app) |
297 | path = d.getVar('PATH', d, True) | 306 | path = d.getVar('PATH', d, True) |