GIF89a; EcchiShell v1.0
//bin/

Mass Deface Email Grabber

/dev/null 2>&1 if [ $? -ne 0 ] then echo "ERROR: cscope is not in \$PATH" >&2 echo " Please set \$PATH correctly or make sure cscope is installed" >&2 exit 1 fi # popup editor #XCS_EDITOR=${HOME}/bin/x_cscope_editor XCS_EDITOR=${HOME}/bin/xme if [ -n "$DISPLAY" -a -x ${XCS_EDITOR} ] then EDITOR=${XCS_EDITOR} export EDITOR fi unset XCS_EDITOR # # Misc defaults #FORCE=N #NOUPDATE= FORCE=Y # hops - default to force rather than query NOUPDATE=-d # hops - default to no update if files already exist QUICK= SPECDEST= # hops - query for files # # Parse the command line set -- `getopt xfqdu $*` if [ $? -ne 0 ] then echo "Use: cs [-x] [-f] [-q] [-u]" >&2 echo " -x debug on " >&2 echo " -q quick Index - faster search but larger index" >&2 echo " -f ask about about regeneration" >&2 echo " -d don't update database (default)" >&2 echo " -u update database" >&2 echo " -s specify where files go" >&2 exit 1 fi for arg do case $arg in -x ) set -x; shift ;; -f ) FORCE=N; NOUPDATE=; shift;; -q ) QUICK=-q; shift ;; -d ) NOUPDATE=-d; shift ;; -u ) NOUPDATE=; shift ;; -s ) SPECDEST=Y; shift ;; esac done # # Here is the security hole. Execute whatever is needed for # this project. A per-project setup script may be available. [ -x ./cscope.rc ] && { . ./cscope.rc } # # We look hard for appropriate files to scope. We ignore items # containing "SCCS" assuming that these are directories of # source code control data. create_list() { LIST=$1 if [ -f ${LIST} ] then [ -n "${NOUPDATE}" ] && return if [ "${FORCE}" != "Y" ] then echo "\n${LIST}" echo "Update the library? <(Y)es, (N)o, (Q)uit> [n] \c" read x y case $x in [Yy]* ) ;; [Qq]* ) exit 1 ;; *) return ;; esac fi echo "Updating library:\n ${LIST} \c" else echo "Creating library:\n ${LIST} \c" fi ( find . -follow -type f \( -name \*.[sScChHlyG] -o \ -name \*.asm -o \ -name \*.cc -o \ -name \*.cxx -o \ -name \*.ccP -o \ -name \*.hP -o \ -name \*.inc -o \ -name \*.ed -o \ -name vuifile -o \ -name Gensymvals -o \ -name \[mM\]ake\* \) \ -print ) | grep -v SCCS | sort -u > ${LIST} echo "\n`cat ${LIST} | wc -l` files listed" } # # Expand the include file list into command line arguments exp_inc() { theInc=$1 if [ -s "${theInc}" ] then for i in `cat ${theInc}` do echo "-I $i \c" done fi } # # This routine does not return to the caller do_cscope() { LIST=$1 CSLIB=$2 INC=$3 shift;shift;shift ARGS="$*" INCARGS=`exp_inc ${INC}` echo "exec cscope" exec $CSCOPE ${ARGS} -p 2 ${INCARGS} -i ${LIST} -f ${CSLIB} echo "exec of $CSCOPE failed" >&2 exit 1 } # # If we have existing libraries, we should use them. std_libs() { DIR=$1 OUT=${DIR}/cscope.out LST=${DIR}/cscope.lst CSD=${DIR}/cscope.csd TMP=${DIR}/cscope.tmplst INC=${DIR}/cscope.inc QCK=${DIR}/cscope.out.po [ -s ${QCK} ] && QUICK=-q [ -f ${CSD} ] && { if [ "${FORCE}" = "Y" ] then do_cscope ${CSD} ${OUT} ${INC} ${QUICK} else do_cscope ${CSD} ${OUT} ${INC} ${QUICK} -d fi } [ -f ${LST} ] && do_cscope ${LST} ${OUT} ${INC} ${QUICK} ${NOUPDATE} [ -f ${TMP} ] && { create_list ${TMP} do_cscope ${TMP} ${OUT} ${INC} ${QUICK} ${NOUPDATE} } } # # ######## main() ####### umask 0 PWD=`pwd` umask 02 # # Check for existing libraries std_libs $PWD std_libs ${HOMEDIR}$PWD std_libs ${SYSDIR}$PWD # # We may need to create one for this area DIR=$PWD if [ ! -n "${NOUPDATE}" -o -n "${SPECDEST}" ] ; then echo "Create new library? <(L)ocal, (H)ome, (S)ystem, (Q)uit> [q] \c" read x y case $x in [Ll]* ) DIR=$PWD ;; [Hh]* ) DIR=${HOMEDIR}$PWD ;; [Ss]* ) DIR=${SYSDIR}$PWD ;; *) exit 1 ;; esac fi [ -d $DIR ] || { mkdir -p $DIR || exit $? } OUT=${DIR}/cscope.out TMP=${DIR}/cscope.tmplst INC=${DIR}/cscope.inc create_list ${TMP} do_cscope ${TMP} ${OUT} ${INC} ${QUICK}