Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!csd4.csd.uwm.edu From: jgd@csd4.csd.uwm.edu (John G Dobnick) Newsgroups: comp.unix.wizards Subject: Re: Question about RCS check-in Message-ID: <4720@uwm.edu> Date: 27 Jun 90 06:19:55 GMT References: <1990Jun22.212249.6130@sq.sq.com> Sender: news@uwm.edu Reply-To: jgd@csd4.csd.uwm.edu Lines: 54 From article <1990Jun22.212249.6130@sq.sq.com>, by lee@sq.sq.com (Liam R. E. Quin): > shaw@hpihoah.HP.COM (Joy-lim Shaw) and others suggest: >> [...] >> You can use: >> $(SRCS): $(RCSDIR)/$$@,v >> @$(CO) $(COFLAGS) $@ >>in your makefiles to checkout files only if their corresponding RCS file >>is newer > The obvious problem is that a change to the date of the ,v file does not > necessarily reflect a change to the actual source file. > > One way round this is to have a shell script "cocmp", say, that does a > co followed by a cmp, and only overwrites the source file if the version > checked out was different. [...] > > Has anyone done this? Strangely enough, yes. In the copy of RCS I obtained (Version 4, from Purdue or from uunet), there is an 'rcsclean' program that does exactly this. Manpage extract follows: ^->RCSCLEAN(L) UNIX Programmer's Manual RCSCLEAN(L) ^-> ^->NAME ^-> rcsclean - clean up working files ^-> [...] ^-> ^->DESCRIPTION ^-> Rcsclean removes working files that were checked out and ^-> never modified. For each file given, rcsclean compares the ^-> working file and a revision in the corresponding RCS file. ^-> If it finds no difference, it removes the working file, and, ^-> if the revision was locked by the caller, unlocks the revi- ^-> sion. ^-> [...] ^-> ^->EXAMPLES ^-> The command ^-> ^-> rcsclean *.c *.h ^-> ^-> removes all working files ending in ".c" or ".h" that were ^-> not changed since their checkout. [...] -- John G Dobnick (JGD2) Computing Services Division @ University of Wisconsin - Milwaukee INTERNET: jgd@csd4.csd.uwm.edu ATTnet: (414) 229-5727 UUCP: uunet!uwm!csd4.csd.uwm.edu!jgd "Knowing how things work is the basis for appreciation, and is thus a source of civilized delight." -- William Safire