[net.unix] SCCS unedit

michaelm@bcsaic.UUCP (michael maxwell) (01/24/86)

Is there a quick way to get SCCS to unedit all files which haven't been
modified?  My problem is this: I do an SCCS edit of the SCCS directory, which
has on the order of 20 files.  I do some testing of the system defined by
these files, in the process modifying *some* of them.  When I get done, I want
SCCS to delta the modified ones, but just unedit the others.

What I do now is to run sccs diffs on all 20 files.  If the file has been
changed, I inform the user (me) of the changes and delta it, letting the user
supply the comment; otherwise I just unedit the file.  The trouble is that
some of these files are quite long, and it takes a long time to run sccs
diffs.  It occurred to me that I could examine the time of last modification
of the p-file and the "gotten" file, and only run sccs diffs if the gotten
file has a later date of modification.  It then occurred to me that this is
what "make" is supposed to do, and maybe I could get "make" to do all this for
me.  Now if I just had one or two files, I suppose the Makefile could have 
entries like this ("p.foo" is in the directory SCCS, and "foo" is in the next 
higher directory; the Makefile is assumed to be in the SCCS dir):

p.foo: ../foo
	-if `sccs diffs ../foo` ; \
	sccs unedit ../foo ; \
	else ; \
	sccs delta ../foo ; \
	fi

The problem is, I have 20 or so files, and add a new file from time to time;
so I would have to add a new procedure in my Makefile each time I add a new 
file.  This looks like what make's implicit rules for suffixes were made for, 
except that this time it's a prefix (p.), not a suffix, and there are no
implicit rules for prefixes.

Am I missing something?  Or should I just bite the bullet and use 
"find -name -newer" with "for[each]" in a [c]shell script to create my own
version of make?
-- 
Mike Maxwell
Boeing Artificial Intelligence Center
	...uw-beaver!uw-june!bcsaic!michaelm

larry@geowhiz.UUCP (Larry McVoy) (01/28/86)

In article <439@bcsaic.UUCP> michaelm@bcsaic.UUCP (michael maxwell) writes:
>Is there a quick way to get SCCS to unedit all files which haven't been

I've dealt with this problem by writing my own version of get(1) and 
something called update(1) which replaces admin(1) & delta(1).  I use
my scripts exclusively (when I need something else I hack it in)
and never have to deal with the sccs interface.  I've got about 12 meg
of code, docs, etc which I keep SCCSed for sanities sake (I'm not a neat
person by nature :-).  I posted the doc file and the scripts (csh, if you
want sh I'll give you my attempts, but some sh hacker code do a better job)
to net.sources.  

Hope this helps,
-- 
Larry McVoy
-----------
Arpa:  mcvoy@rsch.wisc.edu                              
Uucp:  {seismo, ihnp4}!uwvax!geowhiz!geophiz!larry      

"If you are undertaking anything substantial, C is the only reasonable 
 choice of programming language"  --  Brian W. Kerninghan