Przeglądaj źródła

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>
Joshua Watt 1 rok temu
rodzic
commit
a22f7d7b53
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      meta/lib/oe/path.py

+ 3 - 0
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. """