diff options
author | Ross Burton <ross@burtonini.com> | 2021-11-17 17:23:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-21 11:05:01 +0000 |
commit | 7320b2b830ac7d692b0ba248fb77a7e2cb431bbc (patch) | |
tree | 1b51c39d07f64129588438c03581eead6c295497 /scripts | |
parent | e9d2a95237a440008172bc3103bcb23c1264ff95 (diff) | |
download | poky-7320b2b830ac7d692b0ba248fb77a7e2cb431bbc.tar.gz |
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lnr | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/scripts/lnr b/scripts/lnr deleted file mode 100755 index a2ac4fec0f..0000000000 --- a/scripts/lnr +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #! /usr/bin/env python3 | ||
2 | # | ||
3 | # SPDX-License-Identifier: GPL-2.0-only | ||
4 | # | ||
5 | |||
6 | # Create a *relative* symlink, just like ln --relative does but without needing | ||
7 | # coreutils 8.16. | ||
8 | |||
9 | import sys, os | ||
10 | |||
11 | if len(sys.argv) != 3: | ||
12 | print("$ lnr TARGET LINK_NAME") | ||
13 | sys.exit(1) | ||
14 | |||
15 | target = sys.argv[1] | ||
16 | linkname = sys.argv[2] | ||
17 | |||
18 | if os.path.isabs(target): | ||
19 | if not os.path.isabs(linkname): | ||
20 | linkname = os.path.abspath(linkname) | ||
21 | start = os.path.dirname(linkname) | ||
22 | target = os.path.relpath(target, start) | ||
23 | |||
24 | os.symlink(target, linkname) | ||