From 5364ac9cba39e9f3baa84344000b50de299ea8fa Mon Sep 17 00:00:00 2001 From: zimoch Date: Fri, 28 May 2004 14:02:02 +0000 Subject: [PATCH] Find tags in this directories and below --- showtags | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 showtags diff --git a/showtags b/showtags new file mode 100755 index 0000000..29d68d1 --- /dev/null +++ b/showtags @@ -0,0 +1,65 @@ +case "$1" in + -h | -\? | --help) + echo "usage: showtags" + echo " Find CVS tags in this directory and subdirectories" + echo " If there is a connection to psip0 (Oracle 9) you get date and time info too" + exit 0 + ;; + -v | --version) + echo '$Author: zimoch $' + echo '$Date: 2004/05/28 14:02:02 $' + echo '$Source: /cvs/G/EPICS/App/scripts/showtags,v $' + exit 0 + ;; + -*) + echo "Unknown option $1. Try: -h, --help, -v, --version" + exit 1 + ;; +esac + +export ORACLE_HOME=/usr/oracle-9.2 + +trap "stty echo" EXIT SIGTERM SIGKILL + +TAGS=$(cvs status -v 2>/dev/null | awk ' +/\(revision:/ {tag[$1]=1} +END {for (i in tag) { print i}} +') + +if [ -d $ORACLE_HOME ] +then + +function jointags() +{ + echo -n \'$1\' + shift + while [ $# != 0 ] + do + echo -n ,\'$1\' + shift + done + echo +} + +TAGLIST=$(jointags $TAGS) + +$ORACLE_HOME/bin/sqlplus -s ssrm_public/pub01@psip0 << EOF +SET PAGESIZE 10000; +SET LINESIZE 1000; +SET SPACE 2; +SET FEEDBACK OFF; +SELECT TAG_NAME AS "Tag", + TAG_DATE AS "Date", + TAG_TIME AS "Time" + FROM SSRM.CVS_TAGS_VIEW + WHERE TAG_NAME IN ($TAGLIST) + ORDER BY TO_DATE(TAG_DATE||' '||TAG_TIME,'DD-MM-YYYY HH24:MI'); +EXIT +EOF + +else + +echo "$TAGS" | sort + +fi +