home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-18 | 49.8 KB | 1,531 lines |
- Newsgroups: comp.sources.misc
- From: nyh@gauss.technion.ac.il (Nadav Har'El)
- Subject: v33i001: gaps - The Get and Put System, Part01/01
- Message-ID: <1992Oct18.201716.28512@sparky.imd.sterling.com>
- X-Md4-Signature: 55939e4bafcd447bf90031015b7f1228
- Date: Sun, 18 Oct 1992 20:17:16 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: nyh@gauss.technion.ac.il (Nadav Har'El)
- Posting-number: Volume 33, Issue 1
- Archive-name: gaps/part01
- Environment: UNIX
- Supersedes: gaps: Volume 32, Issue 88
-
- GAPS - The Get and Put System - is a set of shell scripts for managing
- versions of programs, similar to the idea of RCS or SCCS. But, as opposed
- to those two, the usage of GAPS is very simple and straightforward. The
- shell scripts can be easily ported between unix systems without recompiling,
- and are easy to change if you want to.
-
- For those unfamiliar with the concept of a version history, a complete
- manual gaps.1 is included in this package, which also explains the usage
- of the programs included in this package.
-
- In addition to the basic shell script to put a new version in the history,
- GAPS includes shell scripts to list versions, Check difference between
- versions, change version information, and more.
-
- GAPS supports for each version a name (such as 4.23, 11R5, or any kind of
- format you choose) which is NOT updated automatically - when putting a new
- version in the history file you are told of the last version name, and
- asked to choose a new version name. This makes keeping track of version names
- much easier then with SCCS, with its cumbersome 'p.' files. It also includes
- the ability to write a summary of changes when putting a new version in the
- history file, and to change that summary later with the chver program
- included.
- --------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: README VERSION WHATSNEW chver gaps.1 get lastver
- # mkdistrib.UU put unput vcat vdiff ver vls
- # Wrapped by kent@sparky on Sun Oct 18 15:07:44 1992
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 1)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(4172 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X GAPS Release 5.02 (Revision 58) Readme
- X --------------------------------------
- X
- XGAPS - The Get and Put System - is a set of shell scripts for managing versions
- Xof programs, similar to the idea of RCS or SCCS. But, as opposed to those two,
- Xthe usage of GAPS is very simple and straightforward. The shell scripts can
- Xbe easily ported between unix systems without recompiling, and are easy to
- Xchange if you want to. For those unfamiliar with the concept of a version
- Xhistory, a complete manual gaps.1 is included in this package, which also
- Xexplains the usage of the programs included in this package.
- XIn addition to the basic shell scripts to put a new version in the history,
- Xand to restore an older version from the history, GAPS includes shell scripts
- Xto list versions, Check difference between versions, change version
- Xinformation, and more.
- XGAPS supports for each version a name (such as 4.23, 11R5, or any kind of
- Xformat you choose) which is NOT updated automatically - when putting a new
- Xversion in the history file you are told of the last version name, and
- Xasked to choose a new version name. This makes keeping track of version names
- Xmuch easier then with SCCS, with its cumbersome 'p.' files. It also includes
- Xthe ability to write a summary of changes when putting a new version in the
- Xhistory file, and to change that summary later with the chver program
- Xincluded.
- XGAPS, with its utility mkdistrib, also allows you to easily take a messy
- Xdirectory in which you design the source of some project, and make out
- Xof it a well organized distribution directory, which contain the distribution
- Xversions of the sources.
- XFor more information, read the manual gaps.1 (which should be formatted by
- Xtroff -man).
- X
- XTo install GAPS, simply copy chver, get, lastver, put, unput, vcat, vdiff,
- Xmkdistrib, ver and vls to your favorite bin directory, and gaps.1 to a manual
- Xdirectory, and keep VERSION if you want to remember what version of GAPS
- Xyou have.
- XNote that since GAPS' get and SCCS' get have the same name, so if you want to
- Xuse GAPS then either put GAPS in the path before SCCS, or rename GAPS' get.
- X
- XFiles included in this package
- X------------------------------
- X
- XREADME - This file
- XVERSION - version information about all the programs included here
- XWHATSNEW - description of what has changed in GAPS since previous releases
- Xchver - Shell script to change version information
- Xgaps.1 - GAPS manual
- Xget - Get a version from a history file to the working file
- Xlastver - Return the name of the last version saved in the history file
- Xput - Put a new version of the working file into the history file
- Xunput - Undo a put
- Xvcat - Get a version from a history file to standard output
- Xvdiff - Check differences between 2 version
- Xver - this is used by other shell scripts, and should be not be used
- X by the user
- Xvls - List versions in a history file
- Xmkdistrib - A utility for making distribution versions easier.
- X
- XGetting GAPS
- X------------
- X
- XIf you read this readme, you probably have already acquired GAPS. However,
- Xif you want to get the newest version of GAPS, the official annonymous ftp site
- Xis gauss.technion.ac.il (132.68.112.60): go to the directory /gaps, and
- Xmget gaps*.shar.Z
- XFor more information about our local site and programs available on it do
- X'telnet gauss.technion.ac.il 4096'.
- X
- X
- XIf you have any questions, comments, wishes for future releases, bug reports,
- Xor anything else about GAPS, send them to nyh@gauss.technion.ac.il.
- XPlease include in your message the content of your VERSION file, so I will
- Xknow exactly which version you have (if you don't have the VERSION file,
- Xat least include the release number, which can be found on the second line
- Xof any of the GAPS shell scripts, or in the GAPS manual).
- X
- X
- X---
- XNadav Har'El | ###### ######## # | <-- Sorry if
- XEmail: nyh@gauss.technion.ac.il | # # # | you can't
- XDepartment of Mathematics, Technion | # # # | read Hebrew.
- XIsrael Institute of Technology | ######## # ###### | Nadav. ;)
- END_OF_FILE
- if test 4172 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'VERSION' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'VERSION'\"
- else
- echo shar: Extracting \"'VERSION'\" \(551 characters\)
- sed "s/^X//" >'VERSION' <<'END_OF_FILE'
- XGAPS Release 5.02 (Revision 58)
- XSun Sep 27 16:23:44 IDT 1992
- X
- XSource files:
- X-------------
- Xget 5.2 (Sat Sep 19 17:57:14 IDT 1992)
- Xlastver 5.0 (Mon Sep 7 23:40:10 IDT 1992)
- Xput 5.4 (Sat Sep 26 22:29:50 IDT 1992)
- Xunput 5.2 (Sat Sep 26 22:30:20 IDT 1992)
- Xvcat 5.1 (Mon Sep 14 21:40:22 IDT 1992)
- Xvdiff 5.0 (Mon Sep 7 23:41:40 IDT 1992)
- Xver 5.0 (Mon Sep 7 23:42:04 IDT 1992)
- Xvls 5.0 (Mon Sep 7 23:42:21 IDT 1992)
- Xchver 5.3 (Sat Sep 26 22:30:04 IDT 1992)
- Xgaps.1 5.10 (Sun Sep 27 16:15:02 IDT 1992)
- Xmkdistrib 5.4 (Sun Sep 27 16:04:51 IDT 1992)
- END_OF_FILE
- if test 551 -ne `wc -c <'VERSION'`; then
- echo shar: \"'VERSION'\" unpacked with wrong size!
- fi
- # end of 'VERSION'
- fi
- if test -f 'WHATSNEW' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'WHATSNEW'\"
- else
- echo shar: Extracting \"'WHATSNEW'\" \(1586 characters\)
- sed "s/^X//" >'WHATSNEW' <<'END_OF_FILE'
- XUsing this file
- X---------------
- XThis file describes the changes made in GAPS in various releases. To see
- Xwhat's new in GAPS since the release xyz you have, look for section for
- Xthe new features of your xyz version, skip it, and read the next sections
- Xuntil the end of file.
- XNote that on every release the manual is updated, so if you have missed
- Xmany releases, you would probably prefer to reread the manual.
- X
- XNew features is release 4 of GAPS
- X---------------------------------
- X* first public release of GAPS
- X
- XNew features in release 5 of GAPS
- X---------------------------------
- Xnew in release 5: (Revision 36)
- X* mkdistrib utility added, which makes the task of creating distribution
- X versions much easier. see gaps.1
- X* put now does not let you put files which contain a line which is only '.'.
- X this is to prevent problems which accur from such files (because of ed).
- X
- Xnew in release 5.01: (Revision 45)
- X* some compatability fixes
- X* add MD (module date) and PD (project date) to mkdistrib's %?% processing, and
- X added module date to VERSION.
- X* in put, typing a ^ at the end of the summary lets you type another line of
- X summary.
- X* fixed text of errors messages in some of the utilities
- X
- Xnew in release 5.02: (Revision 58)
- X* improve interrupt handling in unput, put, chver and get
- X* add lock file check to put, chver, and unput to prevent to of them working
- X in the same time.
- X* various changes in the manual, such as adding a bug and caveat to the list,
- X explaining new features and rephrasing old ones.
- X* new OLDREVISIONS variable accepted by mkdistrib in the distribution file.
- END_OF_FILE
- if test 1586 -ne `wc -c <'WHATSNEW'`; then
- echo shar: \"'WHATSNEW'\" unpacked with wrong size!
- fi
- # end of 'WHATSNEW'
- fi
- if test -f 'chver' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'chver'\"
- else
- echo shar: Extracting \"'chver'\" \(3818 characters\)
- sed "s/^X//" >'chver' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# chver 5.3: change version name, and other info
- X
- XVERSION=0 # current version
- XUSAGE="Usage: $0 [-<number version> or -v<named version>] file"
- XINPUT=
- X
- Xwhile test "$1" != ""
- Xdo
- X case $1 in
- X -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9])
- X VERSION=$1;; # 1-999 versions
- X -v*) VERSION=$1;;
- X -*) echo "chver: unknown argument $1"
- X echo "$USAGE" 2>&1; exit 1;;
- X *) INPUT=$1
- X case $INPUT in
- X *.H) ;;
- X *) INPUT=$INPUT.H ;;
- X esac ;;
- X esac
- X shift
- Xdone
- Xcase $INPUT in
- X"") echo $USAGE 1>&2; exit 1;;
- Xesac
- X
- Xtest -r $INPUT -a -f $INPUT || { echo "chver: can't open $INPUT" 1>&2; exit 1; }
- XINPUTB=`basename $INPUT .H`
- Xif test -f $INPUTB.!
- Xthen
- X set `cat $INPUTB.!`
- X echo "a $1 is running on history file $INPUT on process $2."
- X echo "if this is not true, please remove lock file \"$INPUTB.!\""
- X exit 2;
- Xfi
- Xecho "chver $$" >$INPUTB.!
- Xtrap 'rm -f /tmp/chver.[a-g]$$ '$INPUTB.!'; exit 1' 1 2 3 15
- X
- Xcase $VERSION in
- X-v*) VERSION=`ver "\`expr \"$VERSION\" : '^-v\(.*\)'\`" $INPUT` || exit 1;;
- Xesac
- X
- Xawk < $INPUT '
- X /^@@\^/ {
- X count++
- X if((count-1)== - '$VERSION')
- X print $0 > "'/tmp/chver.c$$'"
- X else if (count > - '$VERSION')
- X print $0 > "'/tmp/chver.b$$'"
- X else print $0 > "'/tmp/chver.a$$'"
- X }
- X !/^@@\^/ {
- X if(count > - '$VERSION')
- X print $0 > "'/tmp/chver.b$$'"
- X else
- X print $0 > "'/tmp/chver.a$$'"
- X }
- X'
- X
- Xif test ! -f /tmp/chver.c$$
- Xthen
- X echo "Chver: no such version $VERSION." 1>&2
- X exit 1
- Xfi
- X
- X#a: first part to be copied to ouput
- X#c: line edited
- X#b: last part copied to output
- X#----------------------------------------
- X#d: version name
- X#e: owner
- X#f: date
- X#g: summary (^ changed to newlines)
- X
- Xawk -F\^ </tmp/chver.c$$ '
- X { print $2 > "'/tmp/chver.d$$'"
- X print $3 > "'/tmp/chver.e$$'"
- X print $4 > "'/tmp/chver.f$$'"
- X for(i=5; i<=NF; i++)
- X print $i > "'/tmp/chver.g$$'"
- X }
- X'
- Xecho "Editing version $VERSION in history file $INPUT."
- Xecho "Current version name: `cat /tmp/chver.d$$`"
- Xwhile :
- Xdo
- X echo -n "Do you want to change the version name (y/n)? "
- X read reply
- X case $reply in
- X y*|Y*)
- X while :
- X do
- X echo -n 'Version: '
- X read Version
- X case $Version in
- X "") echo "Chver: NULL version not allowed." 1>&2;;
- X *\^*) echo "Chver: '^' character not allowed in version." 1>&2;;
- X *) break;;
- X esac
- X done
- X echo "$Version" > /tmp/chver.d$$
- X break;;
- X n*|N*) break;;
- X *) echo "Please enter Yes or No."
- X esac
- Xdone
- Xecho "Current owner name: `cat /tmp/chver.e$$`"
- Xwhile :
- Xdo
- X echo -n "Do you want to change the owner name (y/n)? "
- X read reply
- X case $reply in
- X y*|Y*)
- X while :
- X do
- X echo -n 'Owner: '
- X read Owner
- X case $Owner in
- X *\^*) echo "Chver: '^' character not allowed in owner." 1>&2;;
- X *) break;;
- X esac
- X done
- X echo "$Owner" > /tmp/chver.e$$
- X break;;
- X n*|N*) break;;
- X *) echo "Please enter Yes or No."
- X esac
- Xdone
- Xecho "Current summary is:"
- Xcat /tmp/chver.g$$
- Xwhile :
- Xdo
- X echo -n "Do you want to change the summary (y/n)? "
- X read reply
- X case $reply in
- X y*|Y*)
- X while :
- X do
- X vi /tmp/chver.g$$
- X# note: I don't check here is the user removed or did other nasty things to the
- X# temporary file. maybe someday I will fix that.
- X if fgrep \^@@\^ /tmp/chver.g$$ >/dev/null
- X then
- X echo "Chver: The string ^@@^ must not appear in the summary."
- X echo "Press enter to edit again."
- X read reply
- X continue
- X fi
- X break
- X done
- X break;;
- X n*|N*) break;;
- X *) echo "Please enter Yes or No."
- X esac
- Xdone
- X
- Xtrap '' 1 2 3 15
- Xchmod u+w $INPUT
- Xcat /tmp/chver.a$$ > $INPUT
- Xawk '{printf "@@^%s^",$0}' </tmp/chver.d$$ >>$INPUT
- Xawk '{printf "%s^",$0}' </tmp/chver.e$$ >>$INPUT
- Xawk '{printf "%s",$0}' </tmp/chver.f$$ >>$INPUT
- Xawk '{printf "^%s",$0}' </tmp/chver.g$$ >>$INPUT
- Xecho >>$INPUT
- Xcat /tmp/chver.b$$ 2>/dev/null >>$INPUT
- Xchmod -w $INPUT
- Xecho Version $VERSION change complete.
- Xrm -f /tmp/chver.[a-g]$$ $INPUTB.!
- END_OF_FILE
- if test 3818 -ne `wc -c <'chver'`; then
- echo shar: \"'chver'\" unpacked with wrong size!
- fi
- # end of 'chver'
- fi
- if test -f 'gaps.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gaps.1'\"
- else
- echo shar: Extracting \"'gaps.1'\" \(18468 characters\)
- sed "s/^X//" >'gaps.1' <<'END_OF_FILE'
- X.\" GAPS release 5.02 (revision 58)
- X.\" get and put system - by Nadav Har'El
- X.\" gaps.1 5.10: GAPS manual.
- X.\"
- X.TH "GAPS" 1 "release 5.02" "NYH"
- X.SH NAME
- XGAPS \- Get and put system release 5.02 by Nadav Har'El
- X
- X.SH SYNOPSIS
- X.B chver
- X[
- X.I version
- X]
- X.I file
- X.br
- X.B get
- X[
- X.I version
- X]
- X[
- X.B -o
- X.I outfile
- X]
- X.I file
- X.br
- X.B lastver
- X.I file
- X.br
- X.B put
- X.I file
- X.br
- X.B unput
- X.I file
- X.br
- X.B vcat
- X[
- X.I version
- X]
- X.I file
- X.br
- X.B vdiff
- X[
- X.I version1
- X.I version2
- X]
- X.I file
- X.br
- X.B vls
- X[
- X-a
- X|
- X.I version
- X] file
- X\&...
- X.br
- X.B mkdistrib
- X.I project_name
- X.SH DESCRIPTION
- X.\" .TP - indent, and the next line is a subject
- X.\" .P - stop TP, new paragraph
- X.\" .I - italic
- X.\" blank line - new paragraph (no indent)
- X.I GAPS
- Xis a package for saving a history of the changes to a source code
- Xof a program, or some other ascii file, similar to
- X.I SCCS
- Xor
- X.IR RCS .
- XGAPS allows you to
- X.I put
- Xa new version, therefore saving the changes from the last version,
- X.I get
- Xan older version from the history file, and much more. The revision
- Xhistory is saved in file.H, where file is the name of the source code
- Xor ascii file you are working on.
- X
- XThe history file has the following structure:
- XThe current (last put) version is copied to the beginning of the history
- Xfile, and after that follows a list of changes to make the current version
- Xinto older versions. Notice that here the current version doesn't necessarily
- Xmean the version in the source code file itself, but rather the the version
- Xlast put into the history file.
- X
- XGAPS programs which require a
- X.I version
- Xaccept two kinds of version specifications: The first way to specify a
- Xversion is by a
- X.I number
- Xversion. If -0 is used as a
- X.IR version ,
- Xit will mean the version last put
- Xinto the history file. -1 will mean the previous version, and so on.
- XThe second way, which is probably a lot more convenient is using a
- X.I named
- Xversion. When you use put to put a new version, put tells you the name
- Xof the previous version (unless the history file doesn't exist yet)
- Xand lets you choose a name for the new version. Typical names are
- X1, 1.0, 2.3.4, or such version numbers. Note, that while the
- Xversion name may contain spaces, it is recommended
- Xto use version names without spaces (although GAPS handles version
- Xnames with spaces just as well). When you want to get version 2.3
- Xfrom a file, for example, use
- X.B get
- X-v2.3 file. To see what versions are already saved in the history file,
- Xuse the
- X.B vls
- Xcommand to list the versions saved in the history file. Note that
- Xin all the GAPS commands, the file may be specified either by the
- Xthe source code's name or the history file (ending with .H) name.
- X.B Vls
- Xwill list the version history of all the files specified on the command
- Xline.
- X.BR Vls 's
- Xdefault is to list all the versions in the history. If a version (either
- X.I number
- Xor
- X.I named
- Xversion) is specified somewhere on the command line, then
- X.B vls
- Xwill only list versions newer and including the specified version for each
- Xof the files after that version option. The special option -a tells
- X.B vls
- Xto list all the versions in the next history files.
- XSome example uses of
- X.B vls
- Xare:
- X
- X vls *.H
- X
- XTo list all the versions in all history files in the current directory, and
- X
- X vls -v8.0 *.H
- X
- XTo list all versions newer and including version 8.0 for each history file
- Xin the current directory, and
- X
- X vls file1 -3 file2 file3 -v2.3 file4 -a file5 file6
- X
- Xto list all versions in file1.H, file2.5 and file6.H, list all versions
- Xnewer and including named version 2.3 in file4.H, and to list the newest 4
- Xversions
- X(all versions newer and including numeric version -3) in file2.H and file3.H.
- X
- XEvery version in the history file also has a summary, describing
- Xthe changes made in that version. When you
- X.B put
- Xa file, after being asked for the version name, you are asked you for
- Xthe version's summary. The summary may be null by simply pressing
- X.I ENTER
- Xon the prompt, or set to the wanted summary by entering it in.
- XNotice that the summary should be a single line. If you want to
- Xenter a multiple line summary, use the ^ character wherever you want the
- Xline break. For example, if you enter the summary:
- X
- X this summary^spans multiple^lines.
- X
- XThen vls will report the following summary:
- X
- X Summary: this summary
- X.br
- X spans multiple
- X.br
- X lines.
- X.br
- X
- XIf the last character of the summary is the ^ character, then you are asked
- Xto enter another line, which would be added to the summary on a new line.
- XFor example, if you enter the summary:
- X
- X this summary^ [press ENTER]
- X.br
- X spans multiple^ [press ENTER]
- X.br
- X lines.
- X
- Xyou will get the same summary as in the previous example.
- X
- XEach version also has an owner and a creation date.
- X.B Put
- Xgets the owner
- Xname from the variable LOGNAME, and if it is null or does not exist
- Xthen it calls logname and getuid in that order to find the user's login
- Xid. The login name must not contain the ^ character, and if it does,
- Xthe '?' login name is used instead. Also, the version name must not include
- Xthe ^ character.
- X
- XAll the information about a version, except the creation date can be
- Xchanged with the
- X.B chver
- Xprogram. It asks you if you want to change the
- Xversion name, summary, or owner name, and if you do, it reads new
- Xinformation in the version name or owner name case, and lets you to edit with
- Xthe
- X.I vi
- Xeditor the old summary in the summary case.
- X
- XThe
- X.B get
- Xprogram is used to get a version from the history file, and put
- Xit in the source code file. The version is specified like before - either
- X.RI - n
- Xwhere
- X.I n
- Xis a number, or
- X.RI -v name
- Xwhere
- X.I name
- Xis a name of a version.
- XAnother option to
- X.BR get ,
- Xwhich is sometimes needed, is the -o option. This option should be followed
- Xby a file name, and specifies the name of the output file, instead of
- Xthe file with the same name as the history file, but the .H removed from
- Xthe end (the working source file).
- XA similar program,
- X.BR vcat,
- Xis used to look at a version from an history file, but not to write it on
- Xa file. The version specified to
- X.BR vcat ,
- Xalong with the version forms previously described:
- X.RI - n
- Xand
- X.RI -v name ,
- Xcan be -c which tells
- X.B vcat
- Xto simply cat the version you are now working
- Xon, i.e. the version which is now in the source code file. This is not
- Xvery useful with vcat, but is very useful for
- X.BR vdiff .
- X.B vdiff
- Xis a program to find the difference between two versions in a history file.
- XIt uses
- X.B vcat
- Xso the -c version can be used. Some useful examples of using
- X.BR vdiff :
- X
- X vdiff -0 -c file
- X
- Xtells you the changes you have made to the source code file since the last
- Xput, and
- X
- X vdiff -v1.0 -v2.0 file
- X
- Xshows you the difference between version 1.0 and 2.0 of the file.
- XBecause the first example is so useful, doing simply 'vdiff file', is the
- Xsame as 'vdiff -0 -c file'.
- X
- XAnother useful program provided by GAPS is
- X.BR unput ,
- Xwhich is used to unput the last (maybe accidentally) put version.
- X.B unput
- Xcan only remove the last version, and cannot remove it if it is the only
- Xversion in the history file. The main use of
- X.B unput
- Xis after you accidentally use
- X.BR put ,
- Xand wish you haven't done the put.
- X
- XAnother program supplied by GAPS is
- X.BR lastver ,
- Xwhich is used to find the name of the last version in a history file.
- X
- XAnother, completely different program supplied by GAPS is
- X.BR mkdistrib ,
- Xwhich is used to organize distributions.
- X.BR mkdistrib
- Xis a bit more complicated then the other programs, and it
- Xis not necessary to use it in order to use GAPS, but using it can be
- Xa great help in some or most situations. Let's say you are writing a project
- Xwhich involves writing some source files in some arbitrary language, which
- Xare, of course, manged with GAPS' get and put and other utilities. It
- Xmay also contain files like README which do not have a history, and, of course,
- Xthere are some test programs. Now,
- X.B mkdistrib
- Xcan help you easily pick out
- Xthe latest versions (in the files with history's case, the latest version saved
- Xto the history, not the version currently in the working file) of the important
- Xfiles you want to distribute, and copy
- Xthen into a distribution directory, and create a VERSION file which shows
- Xsome information about the project, which I'll explain later.
- X.B Mkdistrib
- Xalso does some
- Xfiltering on the files copied to the distribution directories, which lets you
- Xnot distribute parts of a file (for example, a makefile might contain information
- Xon how to compile test programs which you don't want to include in the
- Xdistribution), and change specific strings into the current version number,
- Xand other information about the projects. Keep reading for more details.
- X.br
- XThe first thing to do if you want to use
- X.B mkdistrib
- Xis to create a distribution file. A distribution file is a file in the current
- Xdirectory, whose name is .distrib-projectname, where projectname can be any
- Xname, and will be used later as an argument to
- X.BR mkdistrib .
- XThe distribution file contains commands which tell
- X.B mkdistrib
- Xwhat files should be distributed, and more information.
- XThe distribution file is really read in by the shell, so you should take care
- Xin what you put in it. The useful commands to put in it are assignments of
- Xthe following variables:
- X.br
- X.BR NAME :
- XAssign to it the name of your project. For example, in GAPS' distribution
- Xfile, NAME is, of course, "GAPS".
- X.br
- X.BR RELEASE :
- XThis should be the release number of your project. You can assign anything
- Xyou want to it, but the most common thing to do is increment the RELEASE
- Xeach time the project is distributed (i.e. the distribution directory
- Xcreated with mkdistrib is sent to a person or put on a FTP site).
- X.br
- X.BR SOURCESH :
- XThis should be set to the list of sources which have a corresponding history
- Xfiles, and are to be distributed. Note that if there are no such sources,
- Xthen you are allowed not set this variable at all.
- X.br
- X.BR SOURCES :
- XThis is the list of sources which don't have a corresponding history file,
- Xand are to be distributed. Setting this variable is also optional.
- X.br
- X.BR DISTRIBVERSION :
- X.B Mkdistrib
- Xcreates a VERSION file, which contains the name of the project,
- Xits release number (both got from the distribution file), the project revision
- Xnumber (the revision number is the total number of versions saved in the
- Xhistories corresponding to the files in SOURCESH), the current date, and the
- Xnamed version of each of the sources in SOURCESH.
- XBy default, VERSION is copied to the distribution directory. Setting DISTRIBVERSION
- Xto anything but 'yes', will tell
- X.B mkdistrib
- Xnot to copy it.
- X.br
- X.BR DIR :
- XThis option defines the distribution directory. The distribution directory is
- Xthe directory in which
- X.B mkdistrib
- Xputs the files that are to be distributed. The default is Distrib-projectname,
- Xwhere projectname is the option which is given to
- X.BR mkdistrib ,
- Xand is the same as the suffix of the distribution file
- X\&.distrib-projectname. The DIR variable may be set to override this default.
- X.br
- X.BR OLDREVISIONS:
- XIf this option is set, then mkdistrib increments the revision number it finds
- Xfrom the history file by the value given to OLDREVISIONS. This option is
- Xmainly used when a old history file that grew to large is moved from the
- Xdeveloping directory to a backup disk, and you still want to keep the old
- Xrevision count. To do that, before you remove the old history file do
- Xa vls to it, and look at the number of the oldest version (which looks like
- X"(-N)", where N is the number of the last version), which is the last version
- Xin the vls list, and put this number in the OLDREVISIONS variable
- Xof the distribution file, or increment it by that value if that variable was
- Xalready set.
- X
- XSince the distribution file is really a shell script, the advanced user
- Xcan use the more advance features of the shell, such as prompt the user
- Xfor the release number, or maintain a release number counter in a file, or
- Xso on.
- X
- XAs an example, the following is the distribution file for GAPS, which I used
- Xwhile developing release 4 of GAPS.
- X\&.distrib-gaps:
- X
- X.br
- X.in +3m
- X.nf
- X# GAPS source code distribution
- X
- XNAME="GAPS"
- XRELEASE=4
- XSOURCESH="get lastver put unput vcat vdiff ver vls chver gaps.1"
- XSOURCES="README"
- XDIR=Distrib
- X.in -3m
- X.fi
- X.sp
- XNow, each time I want to release the current version of gaps, I run mkdistrib
- X\&gaps, and I get the ready to distribute version in the directory Distrib.
- X
- X.B Mkdistrib
- Xdoes not only copy the most recent version of each of the sources to the
- Xdistribution directory, but also does some processing which increases the
- Xusefulness of
- X.BR mkdistrib .
- XThe first thing it does is to remove unwanted pieces from the distributed
- Xversions of the files. For example, let's say you are writing a project
- Xand for testing it you are using test programs. Now, it's easy to exclude
- Xthose programs from the distribution, by not including them on the SOURCESH
- Xor SOURCES variables. However, your makefile probably contains information
- Xabout how to compile those test programs as well, and this also has to be
- Xremoved from the distributed version. Using
- X.B mkdistrib
- Xit is easy - when it sees a line with %\&dont%distribute% somewhere in it
- Xit does not copy this line, as well as the lines that follow, until a
- Xline with %stop%\&dont%distribute% is found. Since those commands are not
- Xrequired to be on a line of their own, it is simple to put them inside
- Xcomments so that the non-distributed version (the version you work with)
- Xwill have no problem running. Another use of those commands is to cause
- Xsections of code which have not been completed yet not to be included in
- Xthe distributed version, while retaining them in your own version.
- X
- XAnother benefit
- X.B mkdistrib
- Xoffers is the ability to change fixed strings in the source files to
- Xversion information in the distributed file.
- X.B Mkdistrib
- Xrecognizes the following strings, and changes them to what
- XI shall now describe (A description followed by (H.O.) means that that
- Xstring will only be changed when processing a file which has a history):
- X
- X.ft I
- Xstring description of what the string changes into
- X.ft P
- X.br
- X.B %\&M%
- X Module (file) name
- X.br
- X.B %\&P%
- X Project name (from the distribution file)
- X.br
- X.B %\&I%
- X Module version (H.O.)
- X.br
- X.B %\&V%
- X Project release (from the distribution file)
- X.br
- X.B %\&F%
- X Corresponding history file name (H.O.)
- X.br
- X.B %\&Z%
- X The string @(#), which can be found by what(1)
- X.br
- X.B %\&R%
- X Revision number of project
- X.br
- X.B %\&W%
- X Same as: %\&Z%%\&M%<tab>%\&I%
- X.br
- X.B %\&MI%
- X Same as: Module:<tab><tab>%\&M% version %\&I%
- X.br
- X.B %\&PI%
- X Same as: Project:<tab>%\&P% release %\&V% (revision %\&R%)
- X.br
- X.B %\&PD%
- X Project date (current date)
- X.br
- X.B %\&MD%
- X Module date (date of last put) (H.O.)
- X.br
- X
- XNote: In this manual, version, release and revision are
- X.I not
- Xsynonyms.
- XThe first is used to signify a state of one file, which is saved with
- Xput in the file's history, and the latters are
- Xused with distribution and projects in mind: A release is the act of taking the
- Xdistribution directory created by
- X.B mkdistrib
- Xand sending it to other
- Xpeople, thus the release number has to do with the number of release
- Xdone to this project. A revision is the act of making one change in
- Xone file of the source, thus the revision number is the total number
- Xof versions in all history files of this project. This number's only
- Xuse is to compare it to the revision number of a previous release,
- Xto guess who much has changed.
- X
- XOnce more, note that using
- X.B mkdistrib
- Xis optional, and serves a different
- Xpurpose than other utilities supplied by GAPS: All other utilities give
- Xyou a completely general way to keep track of versions of your files, which
- Xyou can name or organize as you want.
- X.B Mkdistrib
- Xallows you to take separate history files and organize a distribution in
- Xa specific format, which you may or may not like. For most purposes
- X.B mkdistrib
- Xis very good
- X.RB ( mkdistrib
- Xwas used to organize GAPS's distribution), but if you want to create a different
- Xtype of distributions, feel free to create it by hand, or create a new
- X.BR mkdistrib -type
- Xprogram to do it automatically (one might even create a Makefile with such
- Xcapabilities), while still using the other GAPS utilities.
- X
- X
- XThe
- X.B GAPS
- Xprograms are written entirely as shell scripts, using awk, ed, diff,
- Xand other useful UNIX utilities. Therefore, they easily run on most
- XUNIX computers.
- X.SH "SEE ALSO"
- X
- Xsccs, rcs, what(1)
- X
- XUNIX utilities used by GAPS:
- X.br
- Xawk(1), cat(1), ed(1), diff(1), sed(1), expr(1), vi(1), sh(1), cp(1),
- Xchmod(1), rm(1), test(1), echo(1), grep(1), fgrep(1), logname(1) or
- Xgetuid(1), date(1), ls(1), mkdir(1)
- X.SH BUGS
- XSummaries which are too long for grep to handle really make GAPS go mad.
- X.br
- XOn a system where there is a limit on file name length (such as the 14
- Xcharacter limit found in system V computers), you cannot keep a history of
- Xa file whose name's length is one less then the limit or the limit itself
- X(i.e. on a computer with a 14 character limit, you can only keep a history
- Xof files with name lengths of 12 or less). Trying to
- X.B put
- Xa file with a longer name cannot hurt, but it simply won't work: if the length
- Xis the limit then
- X.B put
- Xexits with a bogus lock file error (when it trys to add a .! to the end of
- Xthe file to get the lock file name, it gets the same file, which of course
- Xexists), and if the length is one less then the limit, it will look like
- Xput works, but after it finishes, no history file will exist (in fact, it
- Xwas removed by put since it and the lock file are the same file because of
- Xthe limit on file name length).
- X.SH CAVEATS
- XOnly the owner of the history file file may use the writing utilities supplied by GAPS
- X-
- X.BR put ,
- X.BR chver ,
- Xand
- X.BR unput
- Xon that history file. There is no support yet for group or public write access
- Xto history files.
- X.br
- XFor technical reasons, GAPS supports up to 999 versions in one history file.
- XPutting more then that will make you unable to get the very old versions. If
- Xanyone really needs more versions in one history file, I can easily change
- Xthe limit, but I don't think there is such a need.
- X
- X
- XIf you have any questions, comments, wishes for future releases, bug reports,
- Xor anything else about GAPS, send them to
- X.br
- X nyh@gauss.technion.ac.il
- X.br
- XPlease include in your message the content of your VERSION file, so I will
- Xknow exactly which version you have, or in the case you don't have the
- XVERSION file, at least include the GAPS release number, which can be found
- Xin this manual.
- X.SH COPYRIGHT
- XCopyright (C) 1991-1992 by Nadav Har'El,
- X.br
- XE-mail: nyh@gauss.technion.ac.il
- X.br
- XAll Rights Reserved
- END_OF_FILE
- if test 18468 -ne `wc -c <'gaps.1'`; then
- echo shar: \"'gaps.1'\" unpacked with wrong size!
- fi
- # end of 'gaps.1'
- fi
- if test -f 'get' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'get'\"
- else
- echo shar: Extracting \"'get'\" \(1569 characters\)
- sed "s/^X//" >'get' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# get 5.2: extract file from history
- X
- XVERSION=0
- XINPUT=
- XOUTPUT=
- XFILEFLG=
- XUSAGE="Usage: get [-<number version> or -v<named version>] [-o outfile] file"
- X
- Xwhile test "$1" != ""
- Xdo
- X case "$1" in
- X -o) OUTPUT=$2; shift ;;
- X -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9]) VERSION=$1 ;; # 1-999 versions
- X -v*) VERSION=$1;;
- X -*) echo "get: unknown argument $1" 1>&2
- X echo "$USAGE" 1>&2
- X exit 1 ;;
- X *.H) case "$FILEFLG" in
- X y) echo "$USAGE" 1>&2
- X exit 1;;
- X esac
- X FILEFLG=y
- X case "$OUTPUT" in
- X "") OUTPUT=`expr "$1" : '\(.*\)\.H'`
- X esac
- X INPUT=$1;;
- X *) case "$FILEFLG" in
- X y) echo "$USAGE" 1>&2
- X exit 1;;
- X esac
- X FILEFLG=y
- X case "$OUTPUT" in
- X "") OUTPUT=$1
- X esac
- X INPUT=$1.H
- X esac
- X shift
- Xdone
- Xcase $FILEFLG in
- X"") echo "$USAGE" 1>&2
- X exit 1;;
- Xesac
- Xtest -r $INPUT -a -f $INPUT ||
- X { echo "Get: Cannot open $INPUT for input" 1>&2; exit 1; }
- Xtest -w $OUTPUT -a ! -d $OUTPUT -o ! -f $OUTPUT -a ! -d $OUTPUT -a \
- X ! -c $OUTPUT -a ! -b $OUTPUT ||
- X { echo "Get: Cannot open $OUTPUT for writing" 1>&2; exit 1; }
- Xcase $VERSION in
- X-v*) VERSION=`ver "\`expr \"$VERSION\" : '^-v\(.*\)'\`" $INPUT` || exit 1;;
- Xesac
- Xtrap 'rm -f /tmp/get.[ab]$$;exit 1' 1 2 3 15
- X# split into current version and editing command
- Xsed <$INPUT '/^@@\^/q' >/tmp/get.a$$
- Xsed <$INPUT -n '/^@@\^/,$w /tmp/get.b'$$
- Xtrap '' 1 2 3 15
- X# preform the edits
- Xawk </tmp/get.b$$ '
- X /^@@\^/ { count++ }
- X !/^@@\^/ && count > 0 && count <= - '$VERSION'
- X END { print "$d"; print "w", "'$OUTPUT'" }
- X' | ed - /tmp/get.a$$
- Xrm -f /tmp/get.[ab]$$
- END_OF_FILE
- if test 1569 -ne `wc -c <'get'`; then
- echo shar: \"'get'\" unpacked with wrong size!
- fi
- # end of 'get'
- fi
- if test -f 'lastver' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'lastver'\"
- else
- echo shar: Extracting \"'lastver'\" \(305 characters\)
- sed "s/^X//" >'lastver' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# lastver 5.0: find the name of the last version in history
- Xcase $# in
- X1) case $1 in
- X *.H) HIST=$1;;
- X *) HIST=$1.H
- X esac
- X awk -F\^ '/^@@\^/ {print $2; exit}' <$HIST;;
- X*) echo 'Usage: lastver file' 1>&2; exit 1 ;;
- Xesac
- END_OF_FILE
- if test 305 -ne `wc -c <'lastver'`; then
- echo shar: \"'lastver'\" unpacked with wrong size!
- fi
- # end of 'lastver'
- fi
- if test -f 'mkdistrib.UU' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mkdistrib.UU'\"
- else
- echo shar: Extracting \"'mkdistrib.UU'\" \(4392 characters\)
- sed "s/^X//" >'mkdistrib.UU' <<'END_OF_FILE'
- Xbegin 644 mkdistrib
- XM(R$O8FEN+W-H"B,@1T%04R!R96QE87-E(#4N,#(@*')E=FES:6]N(#4X*0HC
- XM(&=E="!A;F0@<'5T('-Y<W1E;2 M(&)Y($YA9&%V($AA<B=%; HC(&UK9&ES
- XM=')I8B U+C0Z($$@=71I;&ET>2!F;W(@;6%K96EN9R!D:7-T<FEB=71I;VX@
- XM=F5R<VEO;G,@96%S:65R+@H*8V%S92 D(R!I;@HQ*0E$25-44DE"/2YD:7-T
- XM<FEB+20Q.SL**BD)96-H;R B57-A9V4Z("0P('!R;VIE8W1?;F%M92(*"6EF
- XM(&QS("UA("YD:7-T<FEB+2H@/B]D978O;G5L;" R/B8Q"@ET:&5N"@D)96-H
- XM;R B079A:6QA8FQE('!R;VIE8W0@;F%M97,Z("@N9&ES=')I8BTJ('!R;VIE
- XM8W0@9&ES=')I8G5T:6]N(&9I;&5S*2(*"0EF;W(@:2!I;B N9&ES=')I8BTJ
- XM"@D)9&\*"0D)97AP<B B)&DB(#H@(EPN9&ES=')I8BU<*"XJ7"DB"@D)9&]N
- XM90H)96QS90H)"65C:&\@(BA.;R!P<F]J96-T(&1I<W1R:6)U=&EO;B!F:6QE
- XM<R!A=F%I;&%B;&4@:6X@=&AI<R!D:7)E8W1O<GDI(@H)9FD*"65X:70@,3L[
- XM"F5S86,*"B,@8VAE8VL@:&]W('1O(&1O(&$@96-H;R!W:71H(&]U="!N97<@
- XM;&EN92!O;B!T:&ES('-Y<W1E;2X*(R H86QT:&]U9V@@+6X@=V]R:W,@;VX@
- XM86QL('-Y<W1E;7,L(&]N('-O;64@:70@8V%U<V5S('1H92!S=')I;F<@=&\@
- XM8F4@9F]L;&]W960*(R!B>2!A('-P86-E*0IC87-E(&!E8VAO(")<8R)@(&EN
- XM"B(B*0E%0CT@(" @(#L@144](EQC(CL["BHI"45"/2(M;B B.R!%13T@(" @
- XM.SL*97-A8PI"/2(((@H*(R!D969A=6QT(&]P=&EO;B H8V%N(&)E(&]V97)I
- XM9&1E;B!B>2!T:&4@9&ES=')I8G5T:6]N(&9I;&4I"@I$25-44DE"5D524TE/
- XM3CUY97,*1$E2/41I<W1R:6(M)#$*3D%-13T[4D5,14%313T[4T]54D-%4ST[
- XM4T]54D-%4T@].T],1%)%5DE324].4STP"@HC(')E860@9&ES=')I8G5T:6]N
- XM(&]P=&EO;B!F:6QE"FEF('1E<W0@+7(@)$1)4U1224(*=&AE;@H):68@+B D
- XM1$E35%))0@H)=&AE;@H)"3H*"65L<V4*"0EE8VAO(%-Y;G1A>"!E<G)O<B!I
- XM;B D1$E35%))0BX*"0EE>&ET(#(*"69I"F5L<V4*"65C:&\@0V%N;F]T(&]P
- XM96X@)$1)4U1224(N"@EE>&ET(#,*9FD*"F5C:&\@)$5"(E-E='1I;F<@=7 Z
- XM("(D144*"B,@<V5T('5P(&1I<W1R:6)U=&EO;B!D:7)E8W1O<GD*:68@=&5S
- XM=" M9" D1$E2"G1H96X*"3H*96QS90H):68@;6MD:7(@)$1)4@H)=&AE;@H)
- XM"3H*"65L<V4*"0EE8VAO(%-O<G)Y+"!B=70@)$1)4B!I<R!A(&9I;&4L('1H
- XM=7,@8V%N;F]T(&)E('5S960@87,@=&AE(&1I<W1R:6)U=&EO;B!D:7)E8W1O
- XM<GDN"@D)97AI=" T"@EF:0IF:0H*2%-/55)#15,]"2,@4T]54D-%4T@L('=I
- XM=&@@+D@@871A8VAE9"!T;R!T:&5M"@HC(R,@<V5T('5P(&9O<B!T:&4@;FEC
- XM92!P<F]G<F5S<R!R97!O<G0@=VAI8V@@=VEL;"!C;VUE(&QA=&5R+B *0E,]
- XM"0DC(&)A8VL@<W!A8V4@<W1R:6YG"D)30CT)"2,@8F%C:R!S<&%C92!A;F0@
- XM8VQE87(@<W1R:6YG"D1/5#T)"2,@9&]T('-T<FEN9PIF;W(@:2!I;B D4T]5
- XM4D-%4T@*9&\*"4A33U520T53/2(D2%-/55)#15,@)&DN2"(*"4)3/2(D0E,D
- XM0B(*"4)30CTB)$)30B1"("1"(@H)1$]4/2(D1$]4+B(*9&]N90IF;W(@:2!I
- XM;B D4T]54D-%4PID;PH)0E,](B1"4R1"(@H)0E-"/2(D0E-")$(@)$(B"@E$
- XM3U0](B1$3U0N(@ID;VYE"@HC(R,C($=E="!P<F]J96-T(&EN9F]R;6%T:6]N
- XM("AR979I<VEO;B!A;F0@9&%T92D*4D56/2)@8V%T("1(4T]54D-%4R!\(&=R
- XM97 @)UY 0%Q>)R!\('=C("UL8"(*"F9O<B!I(&EN("133U520T532 ID;PH)
- XM4D56/2(D4D56("T@,2(*9&]N90I2158]8&5X<'(@)%)%5B K("1/3$12159)
- XM4TE/3E-@"@I$051%/2)@9&%T96 B"F-A=" \/$5.1" ^5D524TE/3B *)$Y!
- XM344@4F5L96%S92 D4D5,14%312 H4F5V:7-I;VX@)%)%5BD*)$1!5$4*"E-O
- XM=7)C92!F:6QE<SH*+2TM+2TM+2TM+2TM+0I%3D0*"F5C:&\@(B @(" @(" @
- XM1&]N92XB"@HC(R,C($=E="!F:6QE(&EN9F]R;6%T:6]N("AP<F]C97-S(&5A
- XM8V@@9FEL92D*96-H;R D14(B4')O8V5S<VEN9R!S;W5R8V5S.B B)$5%"@IE
- XM8VAO("1%0B(D1$]4)$)3(B1%10IF;W(@:2!I;B D4T]54D-%4T@*9&\*"5,]
- XM8&%W:R M1EQ>("<O7D! 7%XO('MP<FEN=&8H(G8])7,@;60]7"(E<UPB7&XB
- XM+"0R+"0T*3L@97AI='TG(#PD:2Y(8 H)979A;" B)%,B"@EE8VAO("1I("(D
- XM=B(@(@DH)&UD*2(@/CY615)324]."@EE8VAO("1%0B)O)$(B)$5%"@H)=F-A
- XM=" D:2!\(&%W:R G"@E"14=)3@D)"0E[(&9L86<],2!]"@DO)7-T;W E7&1O
- XM;G0E9&ES=')I8G5T924O"7L@9FQA9STQ.R!N97AT('T*"2\E7&1O;G0E9&ES
- XM=')I8G5T924O"0E[(&9L86<],#L@;F5X="!]"@D)"0D)>R!I9BAF;&%G*2!P
- XM<FEN="!]"@DG('P@<V5D("(*"7,O)5Q-)2\D:2]G"@ES+R5<4"4O)$Y!344O
- XM9PH)<R\E7$DE+R1V+V<*"7,O)5Q6)2\D4D5,14%312]G"@ES+R5<1B4O)&DN
- XM2"]G"@ES+R5<6B4O0"@C*2]G"@ES+R5<5R4O0"@C*21I"21V+V<*"7,O)5Q-
- XM224O0"@C*4UO9'5L93H)"21I('9E<G-I;VX@)'8O9PH)<R\E7%!))2] *",I
- XM4')O:F5C=#H))$Y!344@<F5L96%S92 D4D5,14%312 H<F5V:7-I;VX@)%)%
- XM5BDO9PH)<R\E7%(E+R12158O9PH)<R\E7%!$)2\D1$%412]G"@ES+R5<340E
- XM+R1M9"]G"@DB(#X@)$1)4B\D:0H*"65C:&\@)$5"(D\B)$5%"F1O;F4*"F-A
- XM<V4@)$1)4U1224)615)324].(&EN"GEE<RD)8W @5D524TE/3B D1$E2(#L[
- XM"F5S86,*"B,@8V]P>2!33U520T53"F9O<B!I(&EN("133U520T53"F1O"@EA
- XM=VL@)PH)0D5'24X)"0D)>R!F;&%G/3$@?0H)+R5S=&]P)5QD;VYT)61I<W1R
- XM:6)U=&4E+PE[(&9L86<],3L@;F5X="!]"@DO)5QD;VYT)61I<W1R:6)U=&4E
- XM+PD)>R!F;&%G/3 [(&YE>'0@?0H)"0D)"7L@:68H9FQA9RD@<')I;G0@?0H)
- XM)R \("1I('P@<V5D("(*"7,O)5Q-)2\D:2]G"@ES+R5<4"4O)$Y!344O9PH)
- XM<R\E7%8E+R1214Q%05-%+V<*"7,O)5Q:)2] *",I+V<*"7,O)5Q7)2] *",I
- XM)&D))'8O9PH)<R\E7$U))2] *",I36]D=6QE.@D))&D@=F5R<VEO;B D=B]G
- XM"@ES+R5<4$DE+T H(RE0<F]J96-T.@DD3D%-12!R96QE87-E("1214Q%05-%
- XM("AR979I<VEO;B D4D56*2]G"@ES+R5<4B4O)%)%5B]G"@ES+R5<4$0E+R1$
- XM051%+V<*"2(@/B D1$E2+R1I"@H)96-H;R D14(B3R(D144*9&]N90H*96-H
- X0;R B)'M"4T)]1&]N92XB"B1I
- X
- Xend
- END_OF_FILE
- if test 4392 -ne `wc -c <'mkdistrib.UU'`; then
- echo shar: \"'mkdistrib.UU'\" unpacked with wrong size!
- else
- echo shar: Uudecoding \"'mkdistrib'\" \(3166 characters\)
- cat mkdistrib.UU | uudecode
- if test -f mkdistrib ; then
- if test 3166 -ne `wc -c <'mkdistrib'`; then
- echo shar: \"'mkdistrib'\" uudecoded with wrong size!
- else
- rm mkdistrib.UU
- fi
- else
- echo shar: \"'mkdistrib'\" uudecode failed completely!
- fi
- fi
- # end of 'mkdistrib.UU'
- fi
- if test -f 'put' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'put'\"
- else
- echo shar: Extracting \"'put'\" \(2245 characters\)
- sed "s/^X//" >'put' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# put 5.4: install file into history
- Xtrap 'exit 1' 1 2 3 15
- Xcase $# in
- X1) case $1 in
- X *.H) HIST=$1
- X set "`expr $HIST : '\(.*\)\.H'`";;
- X *) HIST=$1.H
- X esac
- X if test -f $HIST
- X then
- X chmod u+w $HIST
- X trap 'chmod -w $HIST; exit 1' 1 2 3 15
- X fi ;;
- X*) echo 'Usage: put file' 1>&2; exit 1 ;;
- Xesac
- Xif test ! -r $1 -o ! -f $1
- Xthen
- X echo "Put: can't open $1 for input" 1>&2
- X exit 1
- Xfi
- Xif egrep "^@@\^|^\.$" $1 >/dev/null
- Xthen
- X echo "file contains '@@^' in begining of line, or a line with only a single '.'." 1>&2
- X echo "can't save it." 1>&2
- X exit 1
- Xfi
- X
- XINPUTB=$1
- Xif test -f $INPUTB.!
- Xthen
- X set `cat $INPUTB.!`
- X echo "a $1 is running on history file $INPUT on process $2."
- X echo "if this is not true, please remove lock file \"$INPUTB.!\""
- X exit 2;
- Xfi
- Xecho "put $$" >$INPUTB.!
- X
- Xtrap 'rm -f /tmp/put.[ab]$$ '$INPUTB.!';chmod -w $HIST 2>/dev/null; exit 1' 1 2 3 15
- Xif test -r $HIST
- Xthen
- X echo "Last version of $HIST is \
- X`awk -F\^ '/^@@\^/ {print $2; exit}' <$HIST`"
- Xfi
- X
- Xwhile :
- Xdo
- X echo -n 'Version: '
- X read Version
- X case $Version in
- X "") echo "Put: NULL version not allowed." 1>&2;;
- X *\^*) echo "Put: '^' character not allowed in version." 1>&2;;
- X *) break;;
- X esac
- Xdone
- X
- XSummary=
- Xwhile :
- Xdo
- X case "$Summary" in
- X "") echo -n 'Summary: ';;
- X *) echo -n ' ';;
- X esac
- X read Summary_add
- X Summary="$Summary$Summary_add"
- X case $Summary in
- X *\^@@\^*)
- X echo "Put: The string ^@@^ must not appear in the Summary" 1>&2;;
- X *\^)
- X continue;;
- X *)
- X break;;
- X esac
- Xdone
- Xcase $LOGNAME in
- X"") LOGNAME=`logname 2>/dev/null || getuid 2>/dev/null`
- X case $LOGNAME in
- X *\^*) LOGNAME='?';;
- X esac;;
- X*\^*) LOGNAME='?';;
- Xesac
- X
- Xif get -o /tmp/put.a$$ $1 # previous versions
- Xthen # merge pieces
- X cp $1 /tmp/put.b$$ # current version
- X chmod +w /tmp/put.b$$
- X echo "@@^$Version^$LOGNAME^`date`^$Summary" >> /tmp/put.b$$
- X diff -e $1 /tmp/put.a$$ >> /tmp/put.b$$ # latest diffs
- X sed -n '/^@@\^/,$p' <$HIST >>/tmp/put.b$$ # old diffs
- X trap '' 1 2 3 15
- X cp /tmp/put.b$$ $HIST # put it back
- Xelse # make a new one
- X echo "put: creating $HIST"
- X cp $1 $HIST
- X chmod =rw $HIST
- X echo "@@^$Version^$LOGNAME^`date`^$Summary" >> $HIST
- Xfi
- Xrm -f /tmp/put.*$$ $INPUTB.!
- Xchmod -w $HIST
- END_OF_FILE
- if test 2245 -ne `wc -c <'put'`; then
- echo shar: \"'put'\" unpacked with wrong size!
- fi
- # end of 'put'
- fi
- if test -f 'unput' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unput'\"
- else
- echo shar: Extracting \"'unput'\" \(1308 characters\)
- sed "s/^X//" >'unput' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# unput 5.2: unput the last version from history
- Xtrap 'exit 1' 1 2 3 15
- Xcase $# in
- X1) case $1 in
- X *.H) HIST=$1;;
- X *) HIST=$1.H
- X esac
- X if test -f $HIST
- X then
- X chmod u+w $HIST
- X trap 'chmod -w $HIST; exit 1' 1 2 3 15
- X fi ;;
- X*) echo 'Usage: unput file' 1>&2; exit 1 ;;
- Xesac
- Xif test ! -r $HIST -o ! -f $HIST
- Xthen
- X echo "unput: can't open history file $HIST" 1>&2
- X exit 1
- Xfi
- Xif test `grep "^@@\^" $HIST 2>/dev/null | wc -l` -le 1
- Xthen
- X echo "$HIST has only one version or not an history file." 1>&2
- X echo "Unput failed." 1>&2
- X exit 1
- Xfi
- XINPUTB=`basename $HIST .H`
- Xif test -f $INPUTB.!
- Xthen
- X set `cat $INPUTB.!`
- X echo "a $1 is running on history file $INPUT on process $2."
- X echo "if this is not true, please remove lock file \"$INPUTB.!\""
- X exit 2;
- Xfi
- Xecho "unput $$" >$INPUTB.!
- X
- Xtrap 'rm -f /tmp/unput.[abc]$$ '$INPUTB.!';chmod -w $HIST 2>/dev/null; exit 1' 1 2 3 15
- Xget -1 -o /tmp/unput.a$$ $HIST # get previous version
- Xawk -F\^ <$HIST >/tmp/unput.b$$ ' # find all diffs but last
- X /^@@\^/ { count++
- X if(count==1)print "removed version", $2 >"/tmp/unput.c'$$'" }
- X count >= 2
- X'
- Xtrap '' 1 2 3 15 # ignore signals
- Xcat /tmp/unput.[ab]$$ >$HIST
- Xcat /tmp/unput.c$$ 1>&2
- Xrm -f /tmp/unput.[abc]$$ $INPUTB.!
- Xchmod -w $HIST
- END_OF_FILE
- if test 1308 -ne `wc -c <'unput'`; then
- echo shar: \"'unput'\" unpacked with wrong size!
- fi
- # end of 'unput'
- fi
- if test -f 'vcat' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vcat'\"
- else
- echo shar: Extracting \"'vcat'\" \(1518 characters\)
- sed "s/^X//" >'vcat' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# vcat 5.1: look at one version
- X
- XVERSION=0 # current version
- XUSAGE="Usage: $0 [-<number version> or -v<named version> or -c] file"
- XINPUT=
- X
- Xwhile test "$1" != ""
- Xdo
- X case $1 in
- X -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9])
- X VERSION=$1;; # 1-999 versions
- X -v*) VERSION=$1;;
- X # print current version of file (the version that
- X # will be saved when calling put). useful for doing
- X # vdiff -c -0 file which prints the difference between
- X # file itself and the last saved version of file.
- X -c) VERSION=$1;;
- X -*) echo "vcat: unknown argument $1"
- X echo $USAGE 1>&2; exit 1;;
- X *) INPUT=$1
- X case $INPUT in
- X *.H) ;;
- X *) INPUT=$INPUT.H ;;
- X esac ;;
- X esac
- X shift
- Xdone
- Xcase $INPUT in
- X"") echo $USAGE 1>&2; exit 1;;
- Xesac
- X
- Xtest -r $INPUT -a -f $INPUT || { echo "vcat: can't open $INPUT" 1>&2; exit 1; }
- X
- Xcase $VERSION in
- X-c) cat `expr $INPUT : '\(.*\).H'`
- X exit 0;;
- X-v*) VERSION=`ver "\`expr \"$VERSION\" : '^-v\(.*\)'\`" $INPUT` || exit 1;;
- Xesac
- X
- Xtrap 'rm -f /tmp/vcat.[abc]$$;exit 0' 1 2 3 15
- X# split into current version and editing command
- X# the following doesn't work
- X# sed <$INPUT -n '1,/^@@\^/w /tmp/vcat.a'$$'
- X# /^@@\^/,$w /tmp/vcat.b'$$
- Xsed <$INPUT '/^@@\^/q' >/tmp/vcat.a$$
- Xsed <$INPUT -n '/^@@\^/,$w /tmp/vcat.b'$$
- X# preform the edits
- Xawk </tmp/vcat.b$$ '
- X /^@@\^/ { count++ }
- X !/^@@\^/ && count > 0 && count <= - '$VERSION'
- X END { print "$d"; print "w", "/tmp/vcat.c'$$'" }
- X' | ed - /tmp/vcat.a$$
- Xcat /tmp/vcat.c$$
- Xrm -f /tmp/vcat.[abc]$$
- END_OF_FILE
- if test 1518 -ne `wc -c <'vcat'`; then
- echo shar: \"'vcat'\" unpacked with wrong size!
- fi
- # end of 'vcat'
- fi
- if test -f 'vdiff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vdiff'\"
- else
- echo shar: Extracting \"'vdiff'\" \(577 characters\)
- sed "s/^X//" >'vdiff' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# vdiff 5.0: compare two versions in history
- Xtrap 'rm -f /tmp/vcat[12].$$; exit 1' 1 2 3 15
- Xcase $# in
- X3) case $3 in
- X *.H) file=$3;;
- X *) file=$3.H;;
- X esac;;
- X1) case $1 in
- X *.H) file=$1;;
- X *) file=$1.H;;
- X esac
- X set -- -0 -c;;
- X*) echo "Usage: vdiff version1 version2 file" 1>&2
- X rm -f /tmp/vcat[12].$$
- X exit 1;;
- Xesac
- Xvcat $1 $file >/tmp/vcat1.$$ || { rm -f /tmp/vcat[12].$$;exit 1; }
- Xvcat $2 $file >/tmp/vcat2.$$ || { rm -f /tmp/vcat[12].$$;exit 1; }
- Xdiff /tmp/vcat[12].$$
- Xrm -f /tmp/vcat[12].$$
- END_OF_FILE
- if test 577 -ne `wc -c <'vdiff'`; then
- echo shar: \"'vdiff'\" unpacked with wrong size!
- fi
- # end of 'vdiff'
- fi
- if test -f 'ver' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ver'\"
- else
- echo shar: Extracting \"'ver'\" \(433 characters\)
- sed "s/^X//" >'ver' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# ver 5.0: used in gaps programs for -v<named version> option
- Xcase $2 in
- X*.H) file=$2;;
- X*) file=$2.H;;
- Xesac
- Xif test ! -r $file
- Xthen
- X echo "Can't open $file" 1>&2
- X exit 1
- Xfi
- Xi=`grep "^@@\^" $file 2>/dev/null |
- Xawk '{print NR-1 "^" $0}' | fgrep "^@@^$1^" | awk -F\^ '{print $1}'`
- Xcase $i in
- X"") echo "No Version $1" 1>&2
- X exit 1;;
- X*) echo -"$i";;
- Xesac
- END_OF_FILE
- if test 433 -ne `wc -c <'ver'`; then
- echo shar: \"'ver'\" unpacked with wrong size!
- fi
- # end of 'ver'
- fi
- if test -f 'vls' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vls'\"
- else
- echo shar: Extracting \"'vls'\" \(1005 characters\)
- sed "s/^X//" >'vls' <<'END_OF_FILE'
- X#!/bin/sh
- X# GAPS release 5.02 (revision 58)
- X# get and put system - by Nadav Har'El
- X# vls 5.0: list versions in history
- X
- XVERSION=- # the version to stop on (- if to show all versions)
- XXVERSION=
- X
- Xfor i
- Xdo
- X case $i in
- X -[0-9]|-[0-9][0-9]|-[0-9][0-9][0-9])
- X XVERSION=; VERSION=$i; continue;; # 1-999 versions
- X -a) XVERSION=; VERSION=-; continue;;
- X -v*) XVERSION=$i; continue;;
- X *.H) ;;
- X *) i=$i.H;;
- X esac
- X if test -r $i
- X then
- X # for each file we recalculate the numeric version from the
- X # named version
- X case $XVERSION in
- X -v*) VERSION=`ver "\`expr \"$XVERSION\" : '^-v\(.*\)'\`" $i` || continue;;
- X esac
- X
- X echo
- X echo " $i:"
- X echo
- X if test x$VERSION = x-
- X then
- X grep "^@@\^" $i
- X else
- X grep "^@@\^" $i | awk "{ print; if(NR>(-($VERSION))) exit }"
- X fi |
- X awk -F\^ '
- X { printf "(-%d) Version: %s, Owner: %s, ",NR-1,$2,$3
- X printf "Date: %s",$4
- X printf "\nSummary: %s", $5
- X for(i=6;i<=NF;i++)
- X printf "\n %s",$i
- X print "\n"
- X }'
- X else
- X echo "can't open $i" 1>&2
- X fi
- Xdone
- END_OF_FILE
- if test 1005 -ne `wc -c <'vls'`; then
- echo shar: \"'vls'\" unpacked with wrong size!
- fi
- # end of 'vls'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-