Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-core][PATCH 1/2] lib/oe/path.py: Add relsymlink()
@ 2023-12-20 18:01 Joshua Watt
  2023-12-20 18:01 ` [OE-core][PATCH 2/2] lib/packagedata.py: Fix broken symlinks for providers with a '/' Joshua Watt
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Watt @ 2023-12-20 18:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Joshua Watt

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 <JPEWhacker@gmail.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-20 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 18:01 [OE-core][PATCH 1/2] lib/oe/path.py: Add relsymlink() Joshua Watt
2023-12-20 18:01 ` [OE-core][PATCH 2/2] lib/packagedata.py: Fix broken symlinks for providers with a '/' Joshua Watt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox