summaryrefslogtreecommitdiff
path: root/support/scripts/install.sh
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2005-12-18 18:33:03 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2005-12-18 18:33:03 +0000
commitd3819b93ab8b2de3d5cc35c33b8258ccdb5a931a (patch)
treedfc6f7f497e58ea3321e6f687b11313d2afa86b5 /support/scripts/install.sh
parent0e82079908655682e5140ad521cef0572cb6d2a4 (diff)
downloadscala-d3819b93ab8b2de3d5cc35c33b8258ccdb5a931a.tar.gz
scala-d3819b93ab8b2de3d5cc35c33b8258ccdb5a931a.tar.bz2
scala-d3819b93ab8b2de3d5cc35c33b8258ccdb5a931a.zip
Removed old Scalac code in sources and various ...
Removed old Scalac code in sources and various other obsolete elements.
Diffstat (limited to 'support/scripts/install.sh')
-rw-r--r--support/scripts/install.sh131
1 files changed, 0 insertions, 131 deletions
diff --git a/support/scripts/install.sh b/support/scripts/install.sh
deleted file mode 100644
index fb26219b51..0000000000
--- a/support/scripts/install.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-########################################################-*-Shell-script-*-####
-# Install Function
-##############################################################################
-# $Id$
-
-source ${0%/*}/stdlib.sh;
-
-##############################################################################
-# install
-
-function install-args() {
- case "$1" in
- --version ) echo "install (bash script) $version"; exit 0;;
- -d ) directory="true"; return 1;;
- --directory ) directory="true"; return 1;;
- -D ) leading="true"; return 1;;
- -o ) args-option-value owner "$@";;
- --owner=* ) args-inline-value owner "$@";;
- -g ) args-option-value group "$@";;
- --group=* ) args-inline-value group "$@";;
- -m ) args-option-value mode "$@";;
- --mode=* ) args-inline-value mode "$@";;
- -p ) preserve="true"; return 1;;
- --preserve-timestamps ) preserve="true"; return 1;;
- -* ) args-option-unknown "$@";;
- * ) args-append-array files "$@";;
- esac;
-}
-
-function install-attr() {
- local file="$1";
- if [ -n "$mode" ]; then
- run chmod "$mode" "$file";
- fi;
- if [ -n "$owner" -a -n "$group" ]; then
- run chown "$owner:$group" "$file";
- elif [ -n "$owner" ]; then
- run chown "$owner" "$file";
- elif [ -n "$group" ]; then
- run chown ":$group" "$file";
- fi;
-}
-
-function install-mkdir() {
- local dstpath="$1"; shift 1;
- if [ "$dstpath" != "." ]; then
- run mkdir -p "$dstpath";
- fi;
-}
-
-function install-copy() {
- local srcfile="$1"; shift 1;
- local dstfile="$1"; shift 1;
- run cp "$srcfile" "$dstfile";
- if [ "$preserve" == "true" ]; then
- touch -r "$srcfile" "$dstfile";
- fi;
- install-attr "$dstfile";
-}
-
-function install-dirs() {
- while [ $# -gt 0 ]; do
- local dstpath="$1"; shift 1;
- install-mkdir "$dstpath";
- install-attr "$dstpath";
- done;
-}
-
-function install-file() {
- local srcfile="$1"; shift 1;
- local dstfile="$1"; shift 1;
- local dstpath="`dirname "$dstfile"`";
- if [ "$leading" == "true" ]; then
- install-mkdir "$dstpath";
- fi;
- install-copy "$srcfile" "$dstfile";
-}
-
-function install-files() {
- local dstpath="$1"; shift 1;
- while [ $# -gt 0 ]; do
- local srcfile="$1"; shift 1;
- local dstfile="$dstpath/`basename "$srcfile"`";
- install-copy "$srcfile" "$dstfile";
- done;
-}
-
-function install() {
- local program="$FUNCNAME";
- local version='$Revision$';
- local directory="false";
- local leading="false";
- local owner="";
- local group="";
- local mode="";
- local preserve="false";
- local -a files;
-
- args-loop "$@";
-
- local count="${#files[@]}";
- if [ $count -lt 1 ]; then
- if [ "$directory" == "true" ]; then
- abort "missing target directory";
- else
- abort "missing source file";
- fi;
- fi;
-
- if [ "$directory" == "true" ]; then
- install-dirs "${files[@]}";
- else
- if [ $count -lt 2 ]; then
- abort "missing destination";
- fi;
-
- local last="${files[$(($count-1))]}";
- if [ -d "$last" ]; then
- unset files[$(($count-1))];
- install-files "$last" "${files[@]}";
- elif [ $count -eq 2 ]; then
- install-file "${files[@]}";
- else
- local text1="installing multiple files, but last";
- local text2="argument, '$last' is not a directory";
- abort "$text1 $text2";
- fi;
- fi;
-}
-
-##############################################################################