source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/bootstrap/bin/runrc.cmd@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 1.6 KB
Line 
1/*
2 Copyright 2003-2004 The Apache Software Foundation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 Run RC file, name is in the first arg, second arg is either PATH
17 ENV or -r or nothing
18*/
19
20parse arg name path rest
21
22if name = '' then do
23 say 'RC file name is missing'
24 exit 1
25end
26
27if rest \= '' then do
28 say 'Too many parameters'
29 exit 1
30end
31
32call runit name path
33exit 0
34
35runit: procedure
36parse arg name path dir
37
38if path \= '' & path \= '-r' then do
39 dir = value(translate(path),,'OS2ENVIRONMENT')
40 if dir = '' then return
41 dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */
42end
43
44if dir = '' then dir = directory()
45
46if path = '-r' then do /* recursive call */
47 subdir = filespec('path', dir)
48 if subdir \= '\' then do
49 subdir = left(subdir, length(subdir)-1)
50 call runit name path filespec('drive', dir) || subdir
51 end
52end
53
54/* Look for the file and run it */
55if right(dir, 1) \= '\' then dir = dir || '\'
56rcfile = stream(dir || name, 'c', 'query exists')
57if rcfile \= '' then interpret 'call "' || rcfile || '"'
58
59return
Note: See TracBrowser for help on using the repository browser.