mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 07:27:12 +00:00
scripts/lnr: remove
lnr is a script that implements the same behaviour as 'ln --relative --symlink', as at the time of creation --relative was only available in coreutils 8.16 onwards which was too new for the older supported distros. Now, however, everyone has a new enough coreutils, so we can remove this script. All users of lnr should be replaced with ln --relative --symbolic. (From OE-Core rev: 723b6e40f5943426364bffce7c58ade65c4abbba) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e9d2a95237
commit
7320b2b830
-24
@@ -1,24 +0,0 @@
|
|||||||
#! /usr/bin/env python3
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
|
||||||
#
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
Reference in New Issue
Block a user