www-lcsim/build
diff -u -r1.5 -r1.6
--- detectors-index.sh 10 Apr 2008 21:02:11 -0000 1.5
+++ detectors-index.sh 10 Apr 2008 21:07:21 -0000 1.6
@@ -1,60 +1,52 @@
#!/bin/sh
#
-# Builds an index for detectors/ from detectors/taglist.txt .
+# Builds an index for detectors/ from LCDetectors/detectors/taglist.txt .
+#
+# Set LCDETECTORS in your environment to point to the base dir.
#
-
-#if [ ! -e $tags ]; then
-# echo "ERROR: List of detector tags not found at $tags ."
-# exit 1
-#fi
# make work dir
if [ ! -e ./tmp ]; then
mkdir ./tmp
fi
+# Where is LCDetectors base dir?
if [ -z "$LCDETECTORS" ]; then
echo "LCDETECTORS environment variable is not set"
exit 1
fi
+# Make a work dir.
+mkdir scratch
+
(
- # checkout LCDetectors to work dir
- #cd tmp
- #export CVSROOT=:pserver:[log in to unmask]:/cvs/lcd
- #echo "Checking out LCDetectors ..."
- mkdir scratch
cd scratch
- #cvs co LCDetectors &> /dev/null
-
> ./detectors.inc
> ./compact_all
> ./index.html
+ # Dummy starting tag.
echo "<lccdd>" >> ./compact_all
- #echo "Putting all <info> tags into same file ..."
- # loop over compact descriptions and make a collection of info elements to process
+ # Make the collection of info elements.
for d in `cat $LCDETECTORS/detectors/taglist.txt`; do
xml sel -t -c /lccdd/info $LCDETECTORS/detectors/${d}/compact.xml | grep -v DOCTYPE >> ./compact_all
done
+ # Dummy ending tag.
echo "</lccdd>" >> ./compact_all
- echo "Creating index.html ..."
- # make the index page using XSL processor with stylesheet
+ # Make the index page using an XSL processor with a stylesheet.
xml tr --omit-decl ../xsl/detectors.xsl ./compact_all >> ./index.html
- # tidy up the output HTML file
+ # Tidy up the output.
tidy -raw -m ./index.html &> /dev/null
- # copy the index to detectors/
+ # Make this the new detectors index.
cp ./index.html ../detectors
)
-# remove work dir
-rm -rf ./tmp
-
-echo "DONE"
+# Remove work dir.
+rm -rf ./scratch