diff options
Diffstat (limited to 'meta/lib/oe/path.py')
-rw-r--r-- | meta/lib/oe/path.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index c8d8ad05b9..a1efe97d88 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py | |||
@@ -1,4 +1,6 @@ | |||
1 | # | 1 | # |
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: GPL-2.0-only | 4 | # SPDX-License-Identifier: GPL-2.0-only |
3 | # | 5 | # |
4 | 6 | ||
@@ -8,6 +10,8 @@ import shutil | |||
8 | import subprocess | 10 | import subprocess |
9 | import os.path | 11 | import os.path |
10 | 12 | ||
13 | import bb.parse | ||
14 | |||
11 | def join(*paths): | 15 | def join(*paths): |
12 | """Like os.path.join but doesn't treat absolute RHS specially""" | 16 | """Like os.path.join but doesn't treat absolute RHS specially""" |
13 | return os.path.normpath("/".join(paths)) | 17 | return os.path.normpath("/".join(paths)) |
@@ -75,6 +79,7 @@ def replace_absolute_symlinks(basedir, d): | |||
75 | os.remove(path) | 79 | os.remove(path) |
76 | os.symlink(base, path) | 80 | os.symlink(base, path) |
77 | 81 | ||
82 | @bb.parse.vardepsexclude("TOPDIR") | ||
78 | def format_display(path, metadata): | 83 | def format_display(path, metadata): |
79 | """ Prepare a path for display to the user. """ | 84 | """ Prepare a path for display to the user. """ |
80 | rel = relative(metadata.getVar("TOPDIR"), path) | 85 | rel = relative(metadata.getVar("TOPDIR"), path) |
@@ -123,7 +128,8 @@ def copyhardlinktree(src, dst): | |||
123 | if os.path.isdir(src): | 128 | if os.path.isdir(src): |
124 | if len(glob.glob('%s/.??*' % src)) > 0: | 129 | if len(glob.glob('%s/.??*' % src)) > 0: |
125 | source = './.??* ' | 130 | source = './.??* ' |
126 | source += './*' | 131 | if len(glob.glob('%s/**' % src)) > 0: |
132 | source += './*' | ||
127 | s_dir = src | 133 | s_dir = src |
128 | else: | 134 | else: |
129 | source = src | 135 | source = src |
@@ -169,6 +175,9 @@ def symlink(source, destination, force=False): | |||
169 | if e.errno != errno.EEXIST or os.readlink(destination) != source: | 175 | if e.errno != errno.EEXIST or os.readlink(destination) != source: |
170 | raise | 176 | raise |
171 | 177 | ||
178 | def relsymlink(target, name, force=False): | ||
179 | symlink(os.path.relpath(target, os.path.dirname(name)), name, force=force) | ||
180 | |||
172 | def find(dir, **walkoptions): | 181 | def find(dir, **walkoptions): |
173 | """ Given a directory, recurses into that directory, | 182 | """ Given a directory, recurses into that directory, |
174 | returning all files as absolute paths. """ | 183 | returning all files as absolute paths. """ |