/[meta-cvs]/meta-cvs/F-156CAB88D4EEE783E8C4B4146B5094E2
ViewVC logotype

Contents of /meta-cvs/F-156CAB88D4EEE783E8C4B4146B5094E2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations)
Sat Sep 21 18:28:19 2002 UTC (11 years, 6 months ago) by kaz
Branch: MAIN
Changes since 1.9: +11 -0 lines
* code/install.sh: Check that the installation target path won't
look like a command line option to shell commands.
1 kaz 1.1 #!/bin/sh
2    
3 kaz 1.7 if ! CLISP_PATH="$(which clisp)" ; then
4     echo clisp command not found
5     exit 1
6     fi
7    
8     CLISP_ROOT=$(dirname $(dirname "$CLISP_PATH"))
9     CLISP_LIB="$CLISP_ROOT/lib/clisp"
10    
11 kaz 1.5 LINKSET=unix-bindings-linking-set
12 kaz 1.7 LISPRUN=$LINKSET/lisp.run
13 kaz 1.5
14 kaz 1.1 if [ $# != 1 ] ; then
15 kaz 1.5 echo
16     echo "Meta-CVS Installer"
17     echo
18     echo "Please specify the target prefix, as a full absolute path."
19     echo "For example, specifying /usr/local will place files under"
20     echo "/usr/local/bin and /usr/local/lib."
21     echo
22 kaz 1.1 exit 1
23     else
24 kaz 1.8 TARGET="$1"
25 kaz 1.1 fi
26    
27 kaz 1.8 function space_check ()
28     {
29     if [ $# -gt 1 ] ; then
30 kaz 1.9 echo "The path \"$*\" contains whitespace."
31 kaz 1.8 exit 1
32     fi
33     }
34    
35 kaz 1.10 function dash_check ()
36     {
37     case $1 in
38     -* )
39     echo "The path $1 looks like a command line option."
40     exit 1
41     ;;
42     esac
43     }
44    
45 kaz 1.8 space_check $TARGET
46 kaz 1.10 dash_check $TARGET
47 kaz 1.8
48     TARGET_LIB=$TARGET/lib/clisp/meta-cvs
49     TARGET_BIN=$TARGET/bin
50 kaz 1.5
51     if ! mkdir -p $TARGET_LIB ; then
52     echo "Unable to create $TARGET_LIB directory."
53     exit 1
54     fi
55    
56     if ! mkdir -p $TARGET_BIN ; then
57     echo "Unable to create $TARGET_BIN directory."
58     exit 1
59     fi
60    
61     if [ ! -e $LINKSET ] ; then
62 kaz 1.7 export CLISP_LINKKIT="$CLISP_LIB/linkkit"
63     sh "$CLISP_LIB/clisp-link" add-module-set unix-bindings \
64     "$CLISP_LIB/base" $LINKSET
65 kaz 1.5 fi
66    
67 kaz 1.7 if ! $LISPRUN -M $LINKSET/lispinit.mem -K full -q -c mcvs-main.lisp ; then
68 kaz 1.3 echo "There were compilation errors."
69     exit 1
70     fi
71    
72 kaz 1.7 $LISPRUN -M $LINKSET/lispinit.mem -K full -q -i mcvs-main.lisp -x '(ext:saveinitmem "mcvs.mem" :quiet t)'
73 kaz 1.5
74 kaz 1.8 if ! cp mcvs.mem $TARGET_LIB/lispinit.mem; then
75 kaz 1.9 echo "Unable to copy to $TARGET_LIB."
76 kaz 1.5 exit 1
77     fi
78 kaz 1.1
79 kaz 1.8 if ! cp $LINKSET/lisp.run $TARGET_LIB; then
80 kaz 1.9 echo "Unable to copy to $TARGET_LIB."
81 kaz 1.1 exit 1
82     fi
83    
84 kaz 1.8 if ! cat > $TARGET_BIN/mcvs <<END
85 kaz 1.5 #!$TARGET_LIB/lisp.run -M$TARGET_LIB/lispinit.mem
86 kaz 1.1 (mcvs)
87     END
88     then
89 kaz 1.9 echo "Could not create mcvs script in $TARGET."
90 kaz 1.1 exit 1
91     fi
92    
93 kaz 1.5 if ! chmod a+x "$TARGET_BIN/mcvs" ; then
94 kaz 1.9 echo "Could not set permissions of mcvs script in $TARGET."
95 kaz 1.1 exit 1
96     fi
97    
98     exit 0

  ViewVC Help
Powered by ViewVC 1.1.5