From 2d9f62c76a9041f7deca892d4a9a19d309ce6dd3 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 10 Sep 2011 04:17:04 +0200 Subject: //query/realpath/install: initial commit --- query/realpath/install | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 query/realpath/install (limited to 'query/realpath') diff --git a/query/realpath/install b/query/realpath/install new file mode 100755 index 00000000..74671c81 --- /dev/null +++ b/query/realpath/install @@ -0,0 +1,41 @@ +#! /bin/sh +set -euf + +cd `dirname $0` + +target=../../bin/realpath + +findexe() { + OLDIFS="$IFS" + IFS=: + for d in $PATH; do + f="$d/$1" + if test -f "$f" -a -x "$f"; then + echo $f + IFS="$OLDIFS" + return + fi + done + IFS="$OLDIFS" + ! : +} + +if exe="`findexe readlink`" && $exe -f install | grep -q /install$; then + ! test -e $target || rm $target + cat > $target <&2 + exit +fi + +if type ruby 1>/dev/null 2>/dev/null; then + ln -snf ../query/realpath/src/realpath.rb $target + echo '//query/realpath: install realpath.rb' >&2 + exit +fi + +echo 'Error 2: your system is made of stupid!' +exit 23 -- cgit v1.2.3