From 506e274eaad3a4f55bbbd00a1baea4fc379fc05f Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Fri, 22 Aug 2003 17:07:08 +0000 Subject: . Add a script which checks if ${LINUX_BASE}/${WRKDIRPREFIX} is (possibly indirectly) a symbolic link to ${WRKDIRPREFIX}. . Use this script in preference to the direct symbolic link check previously used, as it handles indirections which cause the same problem. . /compat/linux -> ${LINUXBASE} in the message output if the check detects a link. PR: 43602 --- java/jdk13/scripts/check_wrkdir_links.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 java/jdk13/scripts/check_wrkdir_links.sh (limited to 'java/jdk13/scripts/check_wrkdir_links.sh') diff --git a/java/jdk13/scripts/check_wrkdir_links.sh b/java/jdk13/scripts/check_wrkdir_links.sh new file mode 100644 index 000000000000..bc09f1939219 --- /dev/null +++ b/java/jdk13/scripts/check_wrkdir_links.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# $FreeBSD$ + +WRKDIRPREFIX=$1 +LINUXBASE=$2 + +if [ "x${WRKDIRPREFIX}" = "x" -o "x${LINUXBASE}" = "x" ]; then + exit 0 +fi + +LINUXWRKDIRPREFIX="${LINUXBASE}/${WRKDIRPREFIX}" + +while [ "x${LINUXWRKDIRPREFIX}" != "x" ]; do + if [ -L "${LINUXWRKDIRPREFIX}" -a \ + x`ls -ld "${LINUXWRKDIRPREFIX}" 2>/dev/null | \ + awk '/->/{print $NF;exit 0}END{exit 1}'` = \ + x"${WRKDIRPREFIX}" ]; then + echo "link" + exit 1 + fi + if [ -L "${LINUXWRKDIRPREFIX}" ]; then + LINUXWRKDIRPREFIX=`ls -ld "${LINUXWRKDIRPREFIX}" 2>/dev/null | \ + awk '/->/{print $NF;exit 0}END{exit 1}'` + else + break + fi +done + +exit 0 -- cgit v1.2.3