Rev | Line | |
---|
[1] | 1 | #!/bin/sh -f |
---|
| 2 | |
---|
| 3 | ###set -x |
---|
| 4 | |
---|
| 5 | #------------------------------------------------------------------------------ |
---|
| 6 | # |
---|
| 7 | # 1 absolute source directory |
---|
| 8 | # 2 file name |
---|
| 9 | # 3 absolute installation directory |
---|
| 10 | # 4 installation system command |
---|
| 11 | # |
---|
| 12 | #------------------------------------------------------------------------------ |
---|
| 13 | |
---|
| 14 | source_dir=$1 |
---|
| 15 | file_name=$2 |
---|
| 16 | install_dir=$3 |
---|
| 17 | install_command=$4 |
---|
| 18 | |
---|
| 19 | dest_file_path=${install_dir}/${file_name} |
---|
| 20 | ref_file=${dest_file_path}.cmtref |
---|
| 21 | full_source_name=${source_dir}/${file_name} |
---|
| 22 | |
---|
| 23 | if test "${CMTINSTALLAREA}" = "" ; then |
---|
| 24 | echo "No installation directory specified" |
---|
| 25 | exit 0 |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | b=`echo ${CMTINSTALLAREA} | sed -e 's#/InstallArea##'` |
---|
| 29 | b=`(cd ${b}; pwd)` |
---|
| 30 | a=`pwd | grep -e "${b}"` |
---|
| 31 | if test "${a}" = ""; then |
---|
| 32 | echo "Current directory outside of the installation area. Cannot proceed" |
---|
| 33 | exit 0 |
---|
| 34 | fi |
---|
| 35 | |
---|
| 36 | if test "${install_dir}" = "" ; then |
---|
| 37 | exit 0 |
---|
| 38 | fi |
---|
| 39 | |
---|
| 40 | if test ! -d ${install_dir}; then |
---|
| 41 | mkdir -p ${install_dir} |
---|
| 42 | fi |
---|
| 43 | |
---|
| 44 | if test ! -d ${install_dir}; then |
---|
| 45 | echo "Cannot install file ${file_name}, no installation directory specified" |
---|
| 46 | exit 0 |
---|
| 47 | fi |
---|
| 48 | |
---|
| 49 | echo "Installing file ${file_name} into ${install_dir}" |
---|
| 50 | if test -f ${dest_file_path}; then |
---|
| 51 | /bin/rm -f ${dest_file_path} |
---|
| 52 | fi |
---|
| 53 | |
---|
| 54 | if test -f ${ref_file}; then |
---|
| 55 | /bin/rm -f ${ref_file} |
---|
| 56 | fi |
---|
| 57 | |
---|
| 58 | ${install_command} ${full_source_name} ${dest_file_path} |
---|
| 59 | echo ${full_source_name} >${ref_file} |
---|
Note: See
TracBrowser
for help on using the repository browser.