summaryrefslogtreecommitdiffstats
path: root/scripts/lnr
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lnr')
-rwxr-xr-xscripts/lnr24
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
9import sys, os
10
11if len(sys.argv) != 3:
12 print("$ lnr TARGET LINK_NAME")
13 sys.exit(1)
14
15target = sys.argv[1]
16linkname = sys.argv[2]
17
18if 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
24os.symlink(target, linkname)