Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [OE-core][PATCH 1/2] lib/oe/path.py: Add relsymlink()
Date: Wed, 20 Dec 2023 11:01:01 -0700	[thread overview]
Message-ID: <20231220180102.3501941-1-JPEWhacker@gmail.com> (raw)

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



             reply	other threads:[~2023-12-20 18:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20 18:01 Joshua Watt [this message]
2023-12-20 18:01 ` [OE-core][PATCH 2/2] lib/packagedata.py: Fix broken symlinks for providers with a '/' Joshua Watt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231220180102.3501941-1-JPEWhacker@gmail.com \
    --to=jpewhacker@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox