source: CMT/v1r14p20031120/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=`echo ${CMTINSTALLAREA} | sed -e 's#/InstallArea##'`
29b=`(cd ${b}; pwd)`
30a=`pwd | grep -e "${b}"`
31if test "${a}" = ""; then
32  echo "Current directory outside of the installation area. Cannot proceed"
33  exit 0
34fi
35
36if test "${install_dir}" = "" ; then
37  exit 0
38fi
39
40if test ! -d ${install_dir}; then
41  mkdir -p ${install_dir}
42fi
43
44if test ! -d ${install_dir}; then
45  echo "Cannot install file ${file_name}, no installation directory specified"
46  exit 0
47fi
48
49echo "Installing file ${file_name} into ${install_dir}"
50if test -f ${dest_file_path}; then
51  /bin/rm -f ${dest_file_path}
52fi
53
54if test -f ${ref_file}; then
55  /bin/rm -f ${ref_file}
56fi
57
58${install_command} ${full_source_name} ${dest_file_path}
59echo ${full_source_name} >${ref_file}
Note: See TracBrowser for help on using the repository browser.