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 <[email protected]>
---
 meta/lib/oe/path.py | 3 +++
 1 file changed, 3 insertions(+)

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. """
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192805): 
https://lists.openembedded.org/g/openembedded-core/message/192805
Mute This Topic: https://lists.openembedded.org/mt/103285746/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to