/[MITgcm]/MITgcm/tools/cyrus-imapd-makedepend/install-sh
ViewVC logotype

Annotation of /MITgcm/tools/cyrus-imapd-makedepend/install-sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Feb 25 18:19:54 2004 UTC (20 years, 1 month ago) by edhill
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint58l_post, checkpoint64z, checkpoint57t_post, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint57o_post, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint52l_pre, checkpoint58e_post, mitgcm_mapl_00, checkpoint52n_post, checkpoint53d_post, checkpoint58u_post, checkpoint58w_post, checkpoint54a_pre, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint57s_post, checkpoint54a_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint53c_post, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint52l_post, checkpoint55h_post, checkpoint58n_post, checkpoint53b_post, checkpoint58x_post, checkpoint57g_pre, checkpoint54b_post, checkpoint53b_pre, checkpoint55b_post, checkpoint58t_post, checkpoint58h_post, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint54d_post, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint56c_post, checkpoint52m_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint58q_post, checkpoint54f_post, checkpoint57v_post, checkpoint59q, checkpoint59p, checkpoint55g_post, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, checkpoint53, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint53g_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, hrcube5, checkpoint58o_post, checkpoint57z_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint57c_post, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint58v_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint57j_post, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post, HEAD
 o initial check-in of a better makedepend implementation for AJA

1 edhill 1.1 #!/bin/sh
2     #
3     # Copyright (c) 2000 Carnegie Mellon University. All rights reserved.
4     #
5     # Redistribution and use in source and binary forms, with or without
6     # modification, are permitted provided that the following conditions
7     # are met:
8     #
9     # 1. Redistributions of source code must retain the above copyright
10     # notice, this list of conditions and the following disclaimer.
11     #
12     # 2. Redistributions in binary form must reproduce the above copyright
13     # notice, this list of conditions and the following disclaimer in
14     # the documentation and/or other materials provided with the
15     # distribution.
16     #
17     # 3. The name "Carnegie Mellon University" must not be used to
18     # endorse or promote products derived from this software without
19     # prior written permission. For permission or any other legal
20     # details, please contact
21     # Office of Technology Transfer
22     # Carnegie Mellon University
23     # 5000 Forbes Avenue
24     # Pittsburgh, PA 15213-3890
25     # (412) 268-4387, fax: (412) 268-7395
26     # tech-transfer@andrew.cmu.edu
27     #
28     # 4. Redistributions of any form whatsoever must retain the following
29     # acknowledgment:
30     # "This product includes software developed by Computing Services
31     # at Carnegie Mellon University (http://www.cmu.edu/computing/)."
32     #
33     # CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
34     # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35     # AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
36     # FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
37     # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
38     # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
39     # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40     #
41     # install - install a program, script, or datafile
42     # This comes from X11R5.
43     #
44     # Calling this script install-sh is preferred over install.sh, to prevent
45     # `make' implicit rules from creating a file called install from it
46     # when there is no Makefile.
47     #
48     # This script is compatible with the BSD install script, but was written
49     # from scratch.
50     #
51    
52    
53     # set DOITPROG to echo to test this script
54    
55     # Don't use :- since 4.3BSD and earlier shells don't like it.
56     doit="${DOITPROG-}"
57    
58    
59     # put in absolute paths if you don't have them in your path; or use env. vars.
60    
61     mvprog="${MVPROG-mv}"
62     cpprog="${CPPROG-cp}"
63     chmodprog="${CHMODPROG-chmod}"
64     chownprog="${CHOWNPROG-chown}"
65     chgrpprog="${CHGRPPROG-chgrp}"
66     stripprog="${STRIPPROG-strip}"
67     rmprog="${RMPROG-rm}"
68     mkdirprog="${MKDIRPROG-mkdir}"
69    
70     tranformbasename=""
71     transform_arg=""
72     instcmd="$mvprog"
73     chmodcmd="$chmodprog 0755"
74     chowncmd=""
75     chgrpcmd=""
76     stripcmd=""
77     rmcmd="$rmprog -f"
78     mvcmd="$mvprog"
79     src=""
80     dst=""
81     dir_arg=""
82    
83     while [ x"$1" != x ]; do
84     case $1 in
85     -c) instcmd="$cpprog"
86     shift
87     continue;;
88    
89     -d) dir_arg=true
90     shift
91     continue;;
92    
93     -m) chmodcmd="$chmodprog $2"
94     shift
95     shift
96     continue;;
97    
98     -o) chowncmd="$chownprog $2"
99     shift
100     shift
101     continue;;
102    
103     -g) chgrpcmd="$chgrpprog $2"
104     shift
105     shift
106     continue;;
107    
108     -s) stripcmd="$stripprog"
109     shift
110     continue;;
111    
112     -t=*) transformarg=`echo $1 | sed 's/-t=//'`
113     shift
114     continue;;
115    
116     -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
117     shift
118     continue;;
119    
120     *) if [ x"$src" = x ]
121     then
122     src=$1
123     else
124     # this colon is to work around a 386BSD /bin/sh bug
125     :
126     dst=$1
127     fi
128     shift
129     continue;;
130     esac
131     done
132    
133     if [ x"$src" = x ]
134     then
135     echo "install: no input file specified"
136     exit 1
137     else
138     true
139     fi
140    
141     if [ x"$dir_arg" != x ]; then
142     dst=$src
143     src=""
144    
145     if [ -d $dst ]; then
146     instcmd=:
147     else
148     instcmd=mkdir
149     fi
150     else
151    
152     # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
153     # might cause directories to be created, which would be especially bad
154     # if $src (and thus $dsttmp) contains '*'.
155    
156     if [ -f $src -o -d $src ]
157     then
158     true
159     else
160     echo "install: $src does not exist"
161     exit 1
162     fi
163    
164     if [ x"$dst" = x ]
165     then
166     echo "install: no destination specified"
167     exit 1
168     else
169     true
170     fi
171    
172     # If destination is a directory, append the input filename; if your system
173     # does not like double slashes in filenames, you may need to add some logic
174    
175     if [ -d $dst ]
176     then
177     dst="$dst"/`basename $src`
178     else
179     true
180     fi
181     fi
182    
183     ## this sed command emulates the dirname command
184     dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
185    
186     # Make sure that the destination directory exists.
187     # this part is taken from Noah Friedman's mkinstalldirs script
188    
189     # Skip lots of stat calls in the usual case.
190     if [ ! -d "$dstdir" ]; then
191     defaultIFS='
192     '
193     IFS="${IFS-${defaultIFS}}"
194    
195     oIFS="${IFS}"
196     # Some sh's can't handle IFS=/ for some reason.
197     IFS='%'
198     set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
199     IFS="${oIFS}"
200    
201     pathcomp=''
202    
203     while [ $# -ne 0 ] ; do
204     pathcomp="${pathcomp}${1}"
205     shift
206    
207     if [ ! -d "${pathcomp}" ] ;
208     then
209     $mkdirprog "${pathcomp}"
210     else
211     true
212     fi
213    
214     pathcomp="${pathcomp}/"
215     done
216     fi
217    
218     if [ x"$dir_arg" != x ]
219     then
220     $doit $instcmd $dst &&
221    
222     if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
223     if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
224     if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
225     if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
226     else
227    
228     # If we're going to rename the final executable, determine the name now.
229    
230     if [ x"$transformarg" = x ]
231     then
232     dstfile=`basename $dst`
233     else
234     dstfile=`basename $dst $transformbasename |
235     sed $transformarg`$transformbasename
236     fi
237    
238     # don't allow the sed command to completely eliminate the filename
239    
240     if [ x"$dstfile" = x ]
241     then
242     dstfile=`basename $dst`
243     else
244     true
245     fi
246    
247     # Make a temp file name in the proper directory.
248    
249     dsttmp=$dstdir/#inst.$$#
250    
251     # Move or copy the file name to the temp name
252    
253     $doit $instcmd $src $dsttmp &&
254    
255     trap "rm -f ${dsttmp}" 0 &&
256    
257     # and set any options; do chmod last to preserve setuid bits
258    
259     # If any of these fail, we abort the whole thing. If we want to
260     # ignore errors from any of these, just make sure not to ignore
261     # errors from the above "$doit $instcmd $src $dsttmp" command.
262    
263     if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
264     if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
265     if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
266     if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
267    
268     # Now rename the file to the real destination.
269    
270     $doit $rmcmd -f $dstdir/$dstfile &&
271     $doit $mvcmd $dsttmp $dstdir/$dstfile
272    
273     fi &&
274    
275    
276     exit 0

  ViewVC Help
Powered by ViewVC 1.1.22