Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rudi_m
truffle
test-portable-readlink.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File test-portable-readlink.patch of Package truffle
From ce9e01226b55de2b948bc789233d164047d64c35 Mon Sep 17 00:00:00 2001 From: Ruediger Meier <ruediger.meier@ga-group.nl> Date: Fri, 1 Jun 2012 14:17:20 +0200 Subject: [PATCH] test, portable readlink Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> --- test/truf-test.sh | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/test/truf-test.sh b/test/truf-test.sh index 38fcf3a..a1b7ce1 100755 --- a/test/truf-test.sh +++ b/test/truf-test.sh @@ -27,6 +27,24 @@ while true; do esac done +## some helper funs +xrealpath() +{ + readlink -f "${1}" 2>/dev/null || \ + realpath "${1}" 2>/dev/null || \ + ( + cd "$(dirname "${1}")" || exit 1 + tmp_target="$(basename "${1}")" + # Iterate down a (possible) chain of symlinks + while test -L "${tmp_target}"; do + tmp_target="$(readlink "${tmp_target}")" + cd "$(dirname "${tmp_target}")" || exit 1 + tmp_target="$(basename "${tmp_target}")" + done + echo "$(pwd -P || pwd)/${tmp_target}" + ) 2>/dev/null +} + ## setup fail=0 tool_stdout=$(mktemp) @@ -54,7 +72,7 @@ if test -z "${srcdir}"; then srcdir=$(dirname "${0}") fi if test -x "${builddir}/${TOOL}"; then - TOOL=$(readlink -e "${builddir}/${TOOL}") + TOOL="$(xrealpath "${builddir}/${TOOL}")" fi cd "${srcdir}" -- 1.7.6.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor