summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-12-20 11:01:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-23 08:46:00 +0000
commita22f7d7b533c14c52275f7081627700084527c01 (patch)
tree721dccbc29c44a68e993669017e60d948d6012c5 /meta/lib/oe
parentd59c3c718a5a2bde54910cec573bb0888645dece (diff)
downloadpoky-a22f7d7b533c14c52275f7081627700084527c01.tar.gz
lib/oe/path.py: Add relsymlink()
Adds API to make a relative symbolic link between two directories. The arguments are the same as oe.path.symlink() (From OE-Core rev: 3eeec7f3412e881e51763ef947c82772d3858f09) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/path.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index e2f1913a35..5d21cdcbdf 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -172,6 +172,9 @@ def symlink(source, destination, force=False):
172 if e.errno != errno.EEXIST or os.readlink(destination) != source: 172 if e.errno != errno.EEXIST or os.readlink(destination) != source:
173 raise 173 raise
174 174
175def relsymlink(target, name, force=False):
176 symlink(os.path.relpath(target, os.path.dirname(name)), name, force=force)
177
175def find(dir, **walkoptions): 178def find(dir, **walkoptions):
176 """ Given a directory, recurses into that directory, 179 """ Given a directory, recurses into that directory,
177 returning all files as absolute paths. """ 180 returning all files as absolute paths. """