From ca5d7551235aac0df995ab8d67d0e473a2162abc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 17 Feb 2024 09:57:59 +0100 Subject: New icons, more icons linked into claws-mail theme, and installation of claws-mail theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- apps/rellink | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 apps/rellink (limited to 'apps/rellink') diff --git a/apps/rellink b/apps/rellink new file mode 100755 index 0000000..2981f3f --- /dev/null +++ b/apps/rellink @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +test $# = 2 || test $# = 3 + +target="$1" +link="$2" +destdir="$3" + +test $(printf '%s\n' "$target" "$link" | grep '^/' | wc -l) = 2 + +T="$target" +L="$link" +while test $(printf '%s\n' "$T" "$L" | grep / | wc -l) = 2; do + Td="$(printf '%s\n' "$T" | cut -d / -f 1)" + Ld="$(printf '%s\n' "$L" | cut -d / -f 1)" + if test ! "$Td" = "$Ld"; then + break + fi + T="$(printf '%s\n' "$T" | cut -d / -f 2-)" + L="$(printf '%s\n' "$L" | cut -d / -f 2-)" +done +while printf '%s\n' "$L" | grep / > /dev/null; do + T="$(printf '../%s\n' "$T")" + L="$(printf '%s\n' "$L" | cut -d / -f 2-)" +done +target="$T" + +ln -s -- "$target" "$destdir$link" -- cgit v1.2.3-70-g09d2