[kupfer] Use readlink instead of realpath in kupfer start script
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] Use readlink instead of realpath in kupfer start script
- Date: Mon, 27 Sep 2010 14:15:30 +0000 (UTC)
commit 656b32d9223806dc9f63e7fc7535beb171ad0d7b
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Wed Sep 8 13:30:11 2010 +0200
Use readlink instead of realpath in kupfer start script
As Adi has alerted me, `realpath' is not a generally available
program; instead we use readlink that is part of GNU coreutils. Kupfer
start script updated to deal with the differences (error message when
file does not exist).
bin/kupfer.in | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/bin/kupfer.in b/bin/kupfer.in
index 3ff4dc6..03daecc 100755
--- a/bin/kupfer.in
+++ b/bin/kupfer.in
@@ -22,7 +22,7 @@
PYTHON="@PYTHON@"
PYTHONDIR="@PYTHONDIR@"
test ${PYTHON:0:1} = "@" && PYTHON=python2.6
-test ${PYTHONDIR:0:1} = "@" && PYTHONDIR=$(dirname $(realpath $0))/..
+test ${PYTHONDIR:0:1} = "@" && PYTHONDIR=$(dirname $(readlink -f -- $0))/..
SERVICE="se.kaizer.kupfer"
OBJ="/interface"
@@ -53,7 +53,13 @@ _realpaths () {
# Emit realpaths for arguments, separated by NUL bytes
while test $# != 0
do
- echo -ne $(realpath -- "$1")"\0"
+ LINK=$(readlink -e -- "$1")
+ if test $? != 0 ; then
+ echo "Error: $1 does not exist" > /dev/stderr
+ shift
+ continue
+ fi
+ echo -ne "$LINK\0"
shift
done
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]