Skip to contentSkip to conversation

scripts/lnr: remove

PATCH In review Ross Burton 2 participants 2 messages Nov 17, 2021 – Nov 19, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 scripts/lnr | 24 ------------------------
 1 file changed, 24 deletions(-)
 delete mode 100755 scripts/lnr
scripts/lnr deleted +0 -24
deleted file mode 100755
index a2ac4fec0f..0000000000
@@ -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)
Signature · 1 line
2.25.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · Quentin Schulz

We could have a simple wrapper instead which would be a simple shell script:

#!/bin/sh

ln --relative --symbolic $1 $2

To not require a change in layers?
Not sure it's that important considering that one could do a simple sed across all layers? Anyway just thought about that so shared it.

The point was requiring the change in layers so we're using standard tools and not pointless scripts. I sent patches for some larger layers already so the fallout shouldn't be *too* bad.

Ross