summaryrefslogtreecommitdiff
path: root/libdde_linux26/mk/rel2abs.sh
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:07:53 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:07:53 +0000
commit4fbe7358c7747a9165f776eb19addbb9baf7def2 (patch)
treebc7076b4f6d10c2cc2942539bb666e50f0b66954 /libdde_linux26/mk/rel2abs.sh
parent21adb5284111190057db245cfc2b54091920c373 (diff)
rename libdde_linux26 into libdde-linux26 to make dpkg-source happy
Diffstat (limited to 'libdde_linux26/mk/rel2abs.sh')
-rwxr-xr-xlibdde_linux26/mk/rel2abs.sh72
1 files changed, 0 insertions, 72 deletions
diff --git a/libdde_linux26/mk/rel2abs.sh b/libdde_linux26/mk/rel2abs.sh
deleted file mode 100755
index 33dd8a5b..00000000
--- a/libdde_linux26/mk/rel2abs.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /bin/bash
-#
-# Convert relative path to absolute one
-#
-# Adam Lackorzynski <adam@os.inf.tu-dresden.de>
-#
-
-help()
-{
- echo PWD=\$PWD $0 relpath1 [relpath2 [..]]
- exit $1
-}
-
-convertpath()
-{
- relpath=$1
- basepath=$PWD
- # sanity checks
- [ -z "$relpath" -o -z "$basepath" ] && help 1
- [ "${basepath#/}" = "${basepath}" ] && help 1
- [ "${basepath/\/..\//}" = "${basepath}" ] || help 1
- [ "${basepath/\/.\//}" = "${basepath}" ] || help 1
- [ "${basepath/%\/../}" = "${basepath}" ] || help 1
- [ "${basepath/%\/./}" = "${basepath}" ] || help 1
-
-
- # remove slashes at the end
- while [ "${relpath%/}" != "${relpath}" ];
- do relpath="${relpath%/}"; done
-
- # remove double/multi slashes
- while [ "${relpath/\/\///}" != "${relpath}" ];
- do relpath=${relpath/\/\///}; done
-
- # is relpath relative?
- if [ "${relpath#/}" != "${relpath}" ]; then
- basepath=''
- relpath=${relpath#/}
- fi
-
- relpath="$relpath/"
-
- while [ -n "$relpath" ];
- do
- elem=${relpath%%/*}
- relpath=${relpath#*/}
-
- case $elem in
- .) # skip
- ;;
- ..)
- basepath=${basepath%/*}
- ;;
- *)
- basepath=$basepath/$elem
- ;;
- esac
-
- done
-
- [ -z "$basepath" ] && basepath=/$basepath
-
- echo $basepath
-}
-
-while [ -n "$1" ];
-do
- convertpath $1
- shift
-done
-
-exit 0