Re: Source Control System
Posted in 1995
I wrote a (big) shell script for using sccs and 4gl.
Peter
-----------------------cut here------------------------------------
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: sccs COPYING
# Wrapped by psc@saco.ufra.com on Mon Oct 3 04:01:14 1994
PATH=3D/bin:/usr/bin:/usr/ucb ; export PATHif test -f 'sccs' -a "${1}" !=3D "-c" ; then
echo shar: Will not clobber existing file \\"'sccs'\\"
else
echo shar: Extracting \\"'sccs'\\" \\(17763 characters\\)
sed "s/^X//" >'sccs' <<'END_OF_FILE'
X:
X#------------------------------------------------------#
X#@(#) SCCS-Menu tool
X#@(#) (c) 1990,1991 Peter Schubert
X#@(#) (c) 1994 SACO GmbH
X#
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; version 2 of the License.
X#
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X# GNU General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X#------------------------------------------------------#
X# Plese send a copy to the author if you include new functions:
X# Thank you !!!!!!!!!!!!!!!!!!
X# SACO GmbH
X# Peter Schubert
X# Auhofstrae 9
X# 63741 Aschaffenburg
X# CI$: 10043,1556
X# E-Mail: psc@saco.ufra.com
X#----------------------------------------------------------
X#Textdefs.
X#
X#Menu: at the end of this script
X###################################
XREV=3D`tput rev`
XSTD=3D`tput sgr0`
XDIM=3D`tput dim`
XUL=3D`tput smul`
XCLS=3D`tput clear`
XPROMPT=3D"=3D=3D>\\c"
XPWDQ=3D"Working directory is"
XOK=3D" OK ? [y/n] "
XMODNEU=3D"Save as new File (y/n)"
XAKTLOE=3D"Delete this File (y/n)"
XSELINP=3D"Plese enter your selection"
XFEDIT=3D"Get File for editing (y/n)"
XFVEDIT=3D"Get a special version for editing (y/n)"
XCCGET=3D"Get File to compile (y/n)"
XINFGET=3D"Show File info (y/n)"
XPRUEF=3D"Test SCCS-File (y/n)"
XCOM=3D"Combine SCCS-File (y/n)"
XCOMBOK=3D"Posible result of combine"
XCOMBJA=3D"Combine this file (y/n)"
XSELECT=3D"All Files [a] or select [s]"
XCDPWD=3D"Change to directory"
XBEARB=3D"For every File please answer y or n."
XGETCOMMENT=3D"Please enter your comment:"
XBEARBAUTO=3D"All Files are saved."
XLINE=3D"------------------------------------------------------------------=
-----"
XVERSINP=3D"Enter a version :"
XVERSLOE=3D"Delete a version [y/n] :"
XVERSNEU=3D"Save new version [y/n] :"
X#
X# End Textdefs
X#
X###################################################
X# Path of your SCCS-directory :
X###################################################
XSCCS_PATH=3D"/usr3/source/"
X###################################################
X# If you dont want to use SOURCE2 or SOURCE 3
X# set them to 'nix'
X###################################################
X# INFORMIX 4GL
X###################################################
XSOURCE1=3D.4gl # 1. Source-extention (4gl,COB,c...)
XSOURCE2=3D.per # 2. Source-extention (frm...)
XSOURCE3=3D.txt # 3. Source-extention (txt [I use them for the HELP F=
iles])
XSOURCE4=3D.make # 4. Source-extention (MAKE...)
X###################################################
X# example for C
X###################################################
XSOURCE1=3D.c
XSOURCE2=3D.h
XSOURCE3=3Dnix # not used
XSOURCE4=3Dnix # not used
X###################################################
X# PAGER (e.g. pg or more )
X###################################################
XPAGER=3D"pg"
X###################################################
X# End definition part
X###################################################
X
Xgt_cwd(){
X PWD=3Dx$$
X while [ ! -d $PWD ]
X do
X PWD=3D`pwd`
X ANS=3D
X while [ x${ANS} =3D x ]
X do
X echo "${PWDQ} $PWD"
X echo "${OK} ${PROMPT}"
X read ANS
X case $ANS in
X 'y') break 2;;
X 'n') echo "${CDPWD} ${PROMPT}"
X read PWD
X if [ x$PWD =3D 'x' ]
X then
X PWD=3Dx$$
X fi;;
X *) ANS=3D;;
X esac
X done
X done
X cd $PWD
X echo `pwd`
X}
X
Xadd(){
X echo "${CLS}"
X while true
X do
X ls -xF *$SOURCE1
X if [ "$?" =3D "0" ]
X then
X echo "${SELECT} ${PROMPT}"
X read ANS
X case $ANS in
X 'a') ls *$SOURCE1 |
X while read fil
X do
X admin -i$fil ${SCCS_PATH}s.$fil&& rm $fil
X done
X break;;
X 's' ) li=3D`ls *$SOURCE1 | awk 'NF =3D=3D 1 {print $1} '`
X echo "${LINE}"
X if [ "$li" !=3D "" ]
X then
X set $li
X echo "${BEARB}"
X echo " "
X while [ "$1" !=3D "" ]
X do
X FF=3D`basename $1`
X echo "${REV} $FF ${STD} ${MODNEU} ${PROMPT}"; read antwort
X case $antwort in
X y) admin -i$1 ${SCCS_PATH}s.$1&& rm $1;;
X *) echo;;
X esac
X shift
X done
X fi
X break;;
X esac
X else break
X fi
X break
X done
X if [ "$SOURCE2" !=3D "nix" ]
X then
X while true
X do
X ls -xF *$SOURCE2
X if [ "$?" =3D "0" ]
X then
X echo "${SELECT} ${PROMPT}"
X read ANS
X case $ANS in
X 'a') ls *$SOURCE2 |
X while read fil
X do
X admin -i$fil ${SCCS_PATH}s.$fil&& rm $fil
X done
X break;;
X 's') li=3D`ls *$SOURCE2 | awk 'NF =3D=3D 1 {print $1} '`
X echo "${LINE}"
X if [ "$li" !=3D "" ]
X then
X set $li
X echo "${BEARB}"
X echo " "
X while [ "$1" !=3D "" ]
X do
X FF=3D`basename $1`
X echo "${REV} $FF ${STD} ${MODNEU} ${PROMPT}"; read antwort
X case $antwort in
X y) admin -i$1 ${SCCS_PATH}s.$1&& rm $1 ;;
X *) echo;;
X esac
X shift
X done
X fi@