mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

Change shebang line to python3 and add parentheses to print (From OE-Core rev: 85b6a53386382c0d92b5bea545c2db5e0204e629) Signed-off-by: Allen Wild <allenwild93@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
22 lines
473 B
Python
Executable File
22 lines
473 B
Python
Executable File
#! /usr/bin/env python3
|
|
|
|
# Create a *relative* symlink, just like ln --relative does but without needing
|
|
# coreutils 8.16.
|
|
|
|
import sys, os
|
|
|
|
if len(sys.argv) != 3:
|
|
print("$ lnr TARGET LINK_NAME")
|
|
sys.exit(1)
|
|
|
|
target = sys.argv[1]
|
|
linkname = sys.argv[2]
|
|
|
|
if os.path.isabs(target):
|
|
if not os.path.isabs(linkname):
|
|
linkname = os.path.abspath(linkname)
|
|
start = os.path.dirname(linkname)
|
|
target = os.path.relpath(target, start)
|
|
|
|
os.symlink(target, linkname)
|