Debian Codegraph @

bin/ace_components

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Encapsulates set/access of a components file, which records set of
4 # components that were built in a library. Intended to be used by
5 # GNUmakefiles and scripts. See ACE_wrappers/ace/GNUmakefile for an
6 # example.
7 #
8 usage="usage: $0 --ace | --orbsvcs | --tao \
9 [--remove | --set \" <components list> \"]"
10
11 ####
12 #### Make sure that ACE_ROOT, and TAO_ROOT are set.
13 ####
14 if [scip-shell system . . `[`. ! "$ACE_ROOT" ]; then
15 echoscip-shell system . . echo. $0': your ACE_ROOT environment variable is not set!' 1>&2
16 exit -1
17 fi
18 if [scip-shell system . . `[`. ! "$TAO_ROOT" ]; then
19 TAO_ROOT=$ACE_ROOT/TAO
20 export TAO_ROOT
21 fi
22
23 ####
24 #### Process command line arguments.
25 ####
26 if [scip-shell system . . `[`. $# -ge 1 ]; then
27 case $1 in
28 --ace) components_file=$ACE_ROOT/ace/ACE_COMPONENTS.list ;;
29 --orbsvcs)
30 components_file=$TAO_ROOT/orbsvcs/orbsvcs/ORBSVCS_COMPONENTS.list ;;
31 --tao) components_file=$TAO_ROOT/tao/TAO_COMPONENTS.list ;;
32 *) echoscip-shell system . . echo. $usage; exit -1 ;;
33 esac
34 shift
35 else
36 echoscip-shell system . . echo. $usage
37 exit -1
38 fi
39
40 set_components=0
41 append_components=0
42 if [scip-shell system . . `[`. $# -ge 1 ]; then
43 if [scip-shell system . . `[`. $1 = '--set' ]; then
44 set_components=1
45 shift
46 if [scip-shell system . . `[`. $# -eq 1 ]; then
47 components=$1
48 shift
49 else
50 echoscip-shell system . . echo. $usage
51 exit -1
52 fi
53 elif [scip-shell system . . `[`. $1 = '--append' ]; then
54 append_components=1
55 shift
56 if [scip-shell system . . `[`. $# -eq 1 ]; then
57 components=$1
58 shift
59 else
60 echoscip-shell system . . echo. $usage
61 exit -1
62 fi
63 elif [scip-shell system . . `[`. $1 = '--remove' ]; then
64 rmscip-shell system . . rm. -f $components_file
65 else
66 echoscip-shell system . . echo. $usage
67 exit -1
68 fi
69 fi
70
71 if [scip-shell system . . `[`. $set_components -eq 1 ]; then
72 ####
73 #### Update the components file, if it has changed since last set.
74 ####
75 if [scip-shell system . . `[`. -f $components_file ]; then
76 if echoscip-shell system . . echo. "$components" | diffscip-shell system . . diff. - $components_file > /dev/nullscip-shell filesystem . . `/dev/null`.; then
77 :
78 else
79 echoscip-shell system . . echo. "$components" > $components_file
80 fi
81 else
82 echoscip-shell system . . echo. "$components" > $components_file
83 fi
84 elif [scip-shell system . . `[`. $append_components -eq 1 ]; then
85 ####
86 #### Update the components file, if it has changed since last set.
87 ####
88 if [scip-shell system . . `[`. -f $components_file ]; then
89 if catscip-shell system . . cat. $components_file | grepscip-shell system . . grep. "$components" > /dev/nullscip-shell filesystem . . `/dev/null`.; then
90 :
91 else
92 (catscip-shell system . . cat. $components_file; echoscip-shell system . . echo. "$components") | trscip-shell system . . tr. ' ' '\012' | sortscip-shell system . . sort. -u > $components_file.$$
93 mvscip-shell system . . mv. -f $components_file.$$ $components_file
94 fi
95 else
96 echoscip-shell system . . echo. "$components" > $components_file
97 fi
98 else
99 ####
100 #### Access the contents of the components file, if it exists.
101 ####
102 if [scip-shell system . . `[`. -f $components_file ]; then
103 catscip-shell system . . cat. $components_file
104 fi
105 fi