Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / adm_local_without_kernel / unix / config_files / install-sh
1 #! /bin/sh
2
3 chmodParams=""
4 dirParams=""
5 dirPath=""
6 args=""
7
8 while [ x"$1" != x ]; do
9 if test $# != "1"; then
10 case $1 in
11 -c) shift;
12 continue;;
13
14 -d) dirParams="yes"
15 shift;
16 continue;;
17
18 -m) shift;
19 chmodParams=$1
20 shift;
21 continue;;
22
23 *) args="$args $1"
24 shift;
25 continue;;
26 esac
27 else
28 dirPath=$1
29 fi
30 shift;
31 done
32
33 if test x$dirParams = "xyes"; then
34 mkdir -p $dirPath
35 else
36 cp $args $dirPath
37 for arg in $args; do
38 myArg=`basename $arg`
39 if test x$chmodParams != x; then
40 if test -d $dirPath; then
41 chmod $chmodParams $dirPath/$myArg
42 else
43 chmod $chmodParams $dirPath
44 fi
45 else
46 if test -d $dirPath; then
47 chmod a+x $dirPath/$myArg
48 else
49 chmod a+x $dirPath
50 fi
51 fi
52 done
53 fi
54