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