From: Joshua Watt Date: Wed, 20 Dec 2023 18:01:01 +0000 (-0700) Subject: lib/oe/path.py: Add relsymlink() X-Git-Tag: uninative-4.4~642 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eeec7f3412e881e51763ef947c82772d3858f09;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git 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() Signed-off-by: Joshua Watt Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index e2f1913a35c..5d21cdcbdff 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -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. """