summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-03-19 16:47:57 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-03-19 16:47:57 +0000
commit5c2ca905495d94e799d7ac498e042f59a2d0d812 (patch)
tree2ecae57c4fcd82aa24f0a36528dda4dd98f453c6 /bin
parent582953489bf60a5e7e984ae00bdf2e349713ce91 (diff)
downloadATCD-5c2ca905495d94e799d7ac498e042f59a2d0d812.tar.gz
added ace_components
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ace_components80
1 files changed, 80 insertions, 0 deletions
diff --git a/bin/ace_components b/bin/ace_components
new file mode 100755
index 00000000000..0d8a1a086a9
--- /dev/null
+++ b/bin/ace_components
@@ -0,0 +1,80 @@
+#! /bin/sh
+# $Id$
+#
+# Encapsulates set/access of a components file, which records set of
+# components that were built in a library. Intended to be used by
+# Makefiles and scripts. See ACE_wrappers/ace/Makefile for an example.
+#
+usage="usage: $0 --ace | --orbsvcs | --tao \
+ [--remove | --set \" <components list> \"]"
+
+####
+#### Make sure that ACE_ROOT and TAO_ROOT are set.
+####
+if [ ! "$ACE_ROOT" ]; then
+ echo $0': your ACE_ROOT environment variable is not set!' 1>&2
+ exit -1
+fi
+if [ ! "$TAO_ROOT" ]; then
+ TAO_ROOT=$ACE_ROOT/TAO
+ export TAO_ROOT
+fi
+
+####
+#### Process command line arguments.
+####
+if [ $# -ge 1 ]; then
+ case $1 in
+ --ace) components_file=$ACE_ROOT/ace/ACE_COMPONENTS.list ;;
+ --orbsvcs)
+ components_file=$TAO_ROOT/orbsvcs/orbsvcs/ORBSVCS_COMPONENTS.list ;;
+ --tao) components_file=$TAO_ROOT/tao/TAO_COMPONENTS.list ;;
+ *) echo $usage; exit -1 ;;
+ esac
+ shift
+else
+ echo $usage
+ exit -1
+fi
+
+set_components=0
+if [ $# -ge 1 ]; then
+ if [ $1 = '--set' ]; then
+ set_components=1
+ shift
+ if [ $# -eq 1 ]; then
+ components=$1
+ shift
+ else
+ echo $usage
+ exit -1
+ fi
+ elif [ $1 = '--remove' ]; then
+ rm -f $components_file
+ else
+ echo $usage
+ exit -1
+ fi
+fi
+
+if [ $set_components -eq 1 ]; then
+ ####
+ #### Update the components file, if it has changed since last set.
+ ####
+ if [ -f $components_file ]; then
+ if echo "$components" | diff - $components_file > /dev/null; then
+ :
+ else
+ echo "$components" > $components_file
+ fi
+ else
+ echo "$components" > $components_file
+ fi
+else
+ ####
+ #### Access the contents of the components file, if it exists.
+ ####
+ if [ -f $components_file ]; then
+ cat $components_file
+ fi
+fi