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>
This commit is contained in:
Joshua Watt 2023-12-20 11:01:01 -07:00 committed by Richard Purdie
parent d59c3c718a
commit a22f7d7b53

View File

@ -172,6 +172,9 @@ def symlink(source, destination, force=False):
if e.errno != errno.EEXIST or os.readlink(destination) != source:
raise
def relsymlink(target, name, force=False):
symlink(os.path.relpath(target, os.path.dirname(name)), name, force=force)
def find(dir, **walkoptions):
""" Given a directory, recurses into that directory,
returning all files as absolute paths. """