source: CMT/v1r16p20040901/mgr/cmt_install_action.sh @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 1.3 KB
Line 
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
14source_dir=$1
15file_name=$2
16install_dir=$3
17install_command=$4
18
19dest_file_path=${install_dir}/${file_name}
20ref_file=${dest_file_path}.cmtref
21full_source_name=${source_dir}/${file_name}
22
23if test "${CMTINSTALLAREA}" = "" ; then
24  echo "No installation directory specified"
25  exit 0
26fi
27
28b=`(cd ${CMTINSTALLAREA%/InstallArea}; /bin/pwd)`
29a=`/bin/pwd | grep -e "${b}"`
30if test "${a}" = ""; then
31  echo "Current directory outside of the installation area. Cannot proceed"
32  exit 0
33fi
34
35if test "${install_dir}" = "" ; then
36  exit 0
37fi
38
39if test ! -d ${install_dir}; then
40  mkdir -p ${install_dir}
41fi
42
43if test ! -d ${install_dir}; then
44  echo "Cannot install file ${file_name}, no installation directory specified"
45  exit 0
46fi
47
48echo "Installing file ${file_name} into ${install_dir}"
49if test -f ${dest_file_path}; then
50  /bin/rm -f ${dest_file_path}
51fi
52
53if test -f ${ref_file}; then
54  /bin/rm -f ${ref_file}
55fi
56
57${install_command} ${full_source_name} ${dest_file_path}
58echo ${full_source_name} >${ref_file}
Note: See TracBrowser for help on using the repository browser.