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
8 usage
="usage: $0 --ace | --orbsvcs | --tao \
9 [--remove | --set \" <components list> \"]"
12 #### Make sure that ACE_ROOT, and TAO_ROOT are set.
14 if [ ! "$ACE_ROOT" ]; then
15 echo $0': your ACE_ROOT environment variable is not set!' 1>&2
18 if [ ! "$TAO_ROOT" ]; then
19 TAO_ROOT
=$ACE_ROOT/TAO
24 #### Process command line arguments.
28 --ace) components_file
=$ACE_ROOT/ace
/ACE_COMPONENTS.list
;;
30 components_file
=$TAO_ROOT/orbsvcs
/orbsvcs
/ORBSVCS_COMPONENTS.list
;;
31 --tao) components_file
=$TAO_ROOT/tao
/TAO_COMPONENTS.list
;;
32 *) echo $usage; exit -1 ;;
43 if [ $1 = '--set' ]; then
53 elif [ $1 = '--append' ]; then
63 elif [ $1 = '--remove' ]; then
64 rm -f $components_file
71 if [ $set_components -eq 1 ]; then
73 #### Update the components file, if it has changed since last set.
75 if [ -f $components_file ]; then
76 if echo "$components" |
diff - $components_file > /dev
/null
; then
79 echo "$components" > $components_file
82 echo "$components" > $components_file
84 elif [ $append_components -eq 1 ]; then
86 #### Update the components file, if it has changed since last set.
88 if [ -f $components_file ]; then
89 if cat $components_file |
grep "$components" > /dev
/null
; then
92 (cat $components_file; echo "$components") |
tr ' ' '\012' |
sort -u > $components_file.$$
93 mv -f $components_file.$$
$components_file
96 echo "$components" > $components_file
100 #### Access the contents of the components file, if it exists.
102 if [ -f $components_file ]; then