⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sccs.me

📁 早期freebsd实现
💻 ME
📖 第 1 页 / 共 3 页
字号:
that you don't want to lose.The commands:.(bsccs edit \-i1.5.1.1\-1.5.1 prog.csccs delta prog.c.)bwill merge all of your changesinto the release system.If some of the changes conflict,get will print an error;the generated resultshould be carefully examinedbefore the delta is made..sh 2 "A more detailed example".ppThe following technique might be usedto maintain a different version of a program.First,create a directory to contain the new version:.(bmkdir ../newxyzcd ../newxyz.)bEdit a copy of the programon a branch:.(bsccs \-d../xyz edit prog.c.)bWhen using the old version,be sure to use the.b \-bflag to info, check, tell, and cleanto avoid confusion.For example, use:.(bsccs info \-b.)bwhen in the directory.q xyz ..ppIf you want to save a copy of the program(still on the branch)back in the s-file,you can use:.(bsccs -d../xyz deledit prog.c.)bwhich will do a delta on the branchand reedit it for you..ppWhen the experiment is complete, merge it back into the s-fileusing delta:.(bsccs -d../xyz delta prog.c.)bAt this point you must decide whether this versionshould be merged back into the trunk(\c.i i.e.the default version),which may have undergone changes.If so, it can be merged using the.b \-iflag to.i editas described above..sh 2 "A warning".ppBranches should be kept to a minimum.After the first branch from the trunk,\*I's are assigned rather haphazardly,and the structure gets complex fast..sh 1 "Using \*S with Make".pp\*S and make can be made to work togetherwith a little care.A few sample makefilesfor common applications are shown..ppThere are a few basic entries that every makefileought to have.These are:.nr ii 1i.ip a.out(or whatever the makefile generates.)This entry regenerates whatever this makefile issupposed to regenerate.If the makefile regenerates many things,this should be called.q alland should in turnhave dependencies on everythingthe makefile can generate..ip installMoves the objects to the finalresting place,doing any special.i chmod 'sor.i ranlib 'sas appropriate..ip sourcesCreates all the source files from \*S files..ip cleanRemoves all files from the current directorythat can be regenerated from \*S files..ip printPrints the contents of the directory..lpThe examples shown below are only partial examples,and may omit some of these entrieswhen they are deemed to be obvious..ppThe.i cleanentry should not remove files that can beregenerated from the \*S files.It is sufficiently important to have thesource files around at all timesthat the only time they should be removedis when the directory is being mothballed.To do this, the command:.(bsccs clean.)bcan be used.This will remove all files for which an s-fileexists,but which is not being edited..sh 2 "To maintain single programs".ppFrequently there are directories with severallargely unrelated programs(such as simple commands).These can be put into a single makefile:.(bLDFLAGS= \-i \-s.sp \n(psuprog: prog.o	$(CC) $(LDFLAGS) \-o prog prog.oprog.o: prog.c prog.h.sp \n(psuexample: example.o	$(CC) $(LDFLAGS) \-o example example.oexample.o: example.c.sp \n(psu\&.DEFAULT:	sccs get $<.)bThe trick hereis that the .DEFAULT ruleis called every timesomething is neededthat does not exist,and no other rule exists to make it.The explicit dependency of the.b \&.ofile on the.b \&.cfile is important.Another way of doing the same thing is:.(bSRCS=	prog.c prog.h example.c.sp \n(psuLDFLAGS= \-i \-s.sp \n(psuprog: prog.o	$(CC) $(LDFLAGS) \-o prog prog.oprog.o: prog.h.sp \n(psuexample: example.o	$(CC) $(LDFLAGS) \-o example example.o.sp \n(psusources: $(SRCS)$(SRCS):	sccs get $@.)bThere are a couple of advantages to this approach:(1) the explicit dependencies of the .o on the .c files arenot needed,(2) there is an entry called "sources" so if you want to getall the sources you can just say.q "make sources" ,and(3) the makefile is less likely to do confusing thingssince it won't try to.i getthings that do not exist..sh 2 "To maintain a library".ppLibraries that are largely staticare best updated using explicit commands,since.i makedoesn't know about updating them properly.However,libraries that are in the process of being developedcan be handled quite adequately.The problem is that the .o fileshave to be kept out of the libraryas well as in the library..(b# configuration informationOBJS=	a.o b.o c.o d.oSRCS=	a.c b.c c.c d.s x.h y.h z.hTARG=	/usr/lib.sp \n(psu# programsGET=	sccs getREL=AR=	\-arRANLIB=	ranlib.sp \n(psulib.a: $(OBJS)	$(AR) rvu lib.a $(OBJS)	$(RANLIB) lib.a.sp \n(psuinstall: lib.a	sccs check	cp lib.a $(TARG)/lib.a	$(RANLIB) $(TARG)/lib.a.sp \n(psusources: $(SRCS)$(SRCS):	$(GET) $(REL) $@.sp \n(psuprint: sources	pr *.h *.[cs]clean:	rm \-f *.o	rm \-f core a.out $(LIB).)b.ppThe.q "$(REL)"in the getcan be used to get old versionseasily; for example:.(bmake b.o REL=\-r1.3.)b.ppThe.i installentry includes the line.q "sccs check"before anything else.This guarantees that all the s-filesare up to date(\c.i i.e. ,nothing is being edited),and will abort the.i makeif this condition is not met..sh 2 "To maintain a large program".(bOBJS=	a.o b.o c.o d.oSRCS=	a.c b.c c.y d.s x.h y.h z.h.sp \n(psuGET=	sccs getREL=.sp \n(psua.out: $(OBJS)	$(CC) $(LDFLAGS) $(OBJS) $(LIBS).sp \n(psusources: $(SRCS)$(SRCS):	$(GET) $(REL) $@.)b(The.i printand.i cleanentries are identical to the previous case.)This makefile requires copies of the source and object filesto be kept during development.It is probably also wise to include lines of the form:.(ba.o: x.h y.hb.o: z.hc.o: x.h y.h z.hz.h: x.h.)bso that modules will be recompiledif header files change..ppSince.i makedoes not do transitive closure on dependencies,you may find in some makefiles lines like:.(bz.h: x.h	touch z.h.)bThis would be used in cases where file z.hhas a line:.(b#include "x.h".)bin order to bring the mod date of z.h in linewith the mod date of x.h.When you have a makefile such as above,the.i touchcommand can be removed completely;the equivalent effect will be achievedby doing an automatic.i geton z.h..sh 1 "Further Information".ppThe.i "SCCS/PWB User's Manual"gives a deeper descriptionof how to use \*S.Of particular interestare the numbering of branches,the l-file,which gives a description of what deltas were used on a get,and certain other \*S commands..ppThe \*S manual pagesare a good last resort.These should be read by software managersand by people who want to knoweverything about everything..ppBoth of these documents were written without the.i sccsfront end in mind,so most of the examples are slightly different from thosein this document..bp.sz 12.ce.b "Quick Reference".sz.sp 2.sh 1 Commands 1.ppThe following commands should all be preceded with.q sccs .This list is not exhaustive;for more options see.i "Further Information" ..ip get 9nGets files for compilation (not for editing).Id keywords are expanded..ba 9n.nr ii 8n.ip \-r\fI\*I\fPVersion to get..ip \-pSend to standard output rather than to the actual file..ip \-kDon't expand id keywords..ip \-i\fIlist\fPList of deltas to include..ip \-x\fIlist\fPList of deltas to exclude..ip \-mPrecede each line with \*I of creating delta..ip \-c\fIdate\fPDon't apply any deltas created after.i date..ba.ip edit 9nGets files for editing.Id keywords are not expanded.Should be matched with a.i deltacommand..ba 9n.nr ii 8n.ip \-r\fI\*I\fPSame as.i get .If.i \*Ispecifies a release that does not yet exist,the highest numbered delta is retrievedand the new delta is numbered with.i \*I ..ip \-bCreate a branch..ip \-i\fIlist\fPSame as.i get ..ip \-x\fIlist\fPSame as.i get ..ba.ip delta 9nMerge a file gotten using.i editback into the s-file.Collect comments about why this delta was made..ip unedit 9nRemove a file that has been edited previouslywithout merging the changes into the s-file..ip prt 9nProduce a report of changes..ba 9n.nr ii 5n.ip \-tPrint the descriptive text..ip \-ePrint (nearly) everything..ba.ip info 9nGive a list of all files being edited..ba 9n.nr ii 5n.ip \-bIgnore branches..ip \-u[\fIuser\fP]Ignore files not being edited by.i user ..ba.ip check 9nSame as.i info ,except that nothing is printed if nothing is being editedand exit status is returned..ip tell 9nSame as.i info ,except that one line is produced per file being edited containingonly the file name..ip clean 9nRemove all files that can be regenerated from thes-file..ip what 9nFind and print id keywords..ip admin 9nCreate or set parameters on s-files..ba 9n.nr ii 8n.ip \-i\fIfile\fPCreate, using.i fileas the initial contents..ip \-zRebuild the checksum in casethe file has been trashed..ip \-f\fIflag\fPTurn on the.i flag ..ip \-d\fIflag\fPTurn off (delete) the.i flag ..ip \-t\fIfile\fPReplace the descriptive textin the s-file with the contents of.i file .If.i fileis omitted,the text is deleted.Useful for storing documentationor.q "design & implementation"documents to insure they get distributed with thes-file..lpUseful flags are:.ip bAllow branches to be made using the \-b flag to.i edit..ip d\fI\*I\fPDefault \*I to be usedon a.i getor.i edit ..ip iCause.q "No Id Keywords"error messageto be a fatal error rather than a warning..ip tThe module.q type ;the value of this flag replaces the.b %\&Y\&%keyword..ba.ip fix 9nRemove a delta and reedit it..ip delget 9nDo a.i deltafollowed by a.i get ..ip deledit 9nDo a.i deltafollowed by an.i edit ..sh 1 "Id Keywords".nr ii 6n.ip "%\&Z\&%"Expands to.q @\&(#)for the.i whatcommand to find..ip "%\&M\&%"The current module name,.i e.g.,.q prog.c ..ip "%\&I\&%"The highest \*I applied..ip "%\&W\&%"A shorthand for.q "%\&Z\&%%\&M\&% <tab> %\&I\&%" ..ip "%\&G\&%"The date of the deltacorresponding to the.q "%\&I\&%"keyword..ip "%\&R\&%"The current release number,.i i.e. ,the first component of the.q "%\&I\&%"keyword..ip "%\&Y\&%"Replaced by the value of the.b tflag(set by.i admin ).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -