📄 beta.mex
字号:
.PL RIGHT.UH M "Introduction".LPThis document outlines in detail the procedure for building a beta releaseof the SunOS Reference Manual,more commonly known as the``man pages''.It is intended to be followed step by step from beginning to end,although it's a good idea to familiarize yourself somewhat with thisdocument before you start the build..LPThe procedure outlined here applies to a standard beta release ofthe man pages.Thus,there may be problems specific to your build thatare not addressed in this document.It's therefore a good idea to know someone whom you can consultwhen problems arise.Building the man pages is a long,intricate,tiring and often frustrating process,which contains many potential pitfalls.It's important,therefore,that you adhere strictly to the procedureoutlined here..UH S \fBOverview\fP.LPFirst, set up all the online sources (the.L .sofiles)so that the.L mancommand will work as expected (chapter one).Next,update the.L Listpages found at the end of the.L Intropage of each of the eight manual sections (chapter two).Then,update the index and reviewformatting (chapters three, four and five).After that,you'll update the Makefiles,used in setting up the online sources,and the Printfiles,used in printing the manual (chapter six),after which,you'll clone the manual sources from the release machineto your doctools host (chapter seven),and print the manual (chapter eight).Finally,there will be some housekeeping for you to do,including moving back any sources that you've changed sincethe clone,and testing the.L catmancommand (chapter nine)..LPIt may not sound difficult,but it is.Good luck..H C "Setting Up \fL.so\fP Files".LPIn order to set up the correct.L .soreferences and to update the List pagesfor each of the manual sections,you'll need to compile lists of manpages that have been added and deletedsince the last release..H 2 "Get Lists of Pages as of the Last Release".LP.L cdto the.L mandirectory on the release machine(typically.L /usr/src/man ).Once there, you'll need to reconstruct the list of oldentries from the Makefile used in the last release,so you can compare it with a current list offiles under.SM SCCS :.LS 4sccs prt Makefile | more.LEThis displays a version history for.L Makefile .One of the history list entries shouldbe the version used in the last major releaseor build.Retrieve this version from.SM SCCSand put itin.L Makefile.old :.LS 4sccs get -GMakefile.old -r\fIversion\fP Makefile.LEYou can now extract the list of files from.L Makefile.oldand put it in.L FILES.old :.LS 4make -fMakefile.old show | sort -u > FILES.oldvi FILES.old.LEEliminate filenamesthat aren't, in fact, man pages..H 2 "Get Current Lists of Pages".LPNow generate and sort a list of new manual entriesand put it in.L FILES.new :.LS 4ls SCCS/s.* | sed 's/SCCS\e/s\e.//' | sort -u > FILES.newvi FILES.new.LEAgain,remove any entries that aren't man pages..H 2 "Get Lists of Pages Added and Deleted Since the Last Release".LPYou can now use:.LS 4comm -3 FILES.old FILES.new.LEwhich will display two columns on the screen.The left hand column lists entries found in.L FILES.oldbut not in .L FILES.new(deletions)and the right hand column lists entries found in .L FILES.newbut not in .L FILES.old(additions).If there are entries in the left hand column,put them in.L FILES.delete :.LS 4comm -23 FILES.old FILES.new > FILES.delete.LEIf there are entries in the right hand column,put them in.L FILES.add :.LS 4comm -13 FILES.old FILES.new > FILES.add.LERepeat the above process for each of theeight manual sections..H 2 "Generate \fL.so\fP Files".LPNow that you have lists of added man pages in.L FILES.addin each section's source directory,.L cdto one of these directories and generate a listof.L .soreferences:.LS 4\&../bin/getNAME -s `cat FILES.add`.LEThis will display on the screen a shell scriptfor creating any new.L .sofiles that may be needed.If a script does indeed appear on the screen,you will want to run the command again and redirectthe output to.L List.so :.LS 4\&../bin/getNAME -s `cat FILES.add` > List.sovi List.so.LEVerify that the script is correct!Specifically,search for filenames which contain`.' (dot) characters,as.L getNAMEdoes not treat these correctly.Executing.L List.sowill generate the.L .sofiles and echo their filenames to the standardoutput.Therefore,you can create the.L .sofiles and put them under.SM SCCSwith the command.LS 4sccs create `sh List.so`.LE.H C "Updating the \fLList\fP Pages".LPIt remains now to update the List pages of eachmanual section.You'll want to delete the List page entriesfor man pages that have been deleted since thelast release and add entries for the new man pages:.H 2 "Delete Entries of Pages Deleted Since the Last Release".LS 4cp FILES.delete FILES.zapvi FILES.zap.LERemove the section suffixes from the filenameslisted there:.LS 4:%s/\e(.*\e)\e.[1-8].*/\e1/.LENow,.L FILES.zapdoesn't list filenames,but rather lists names of commands or functionsthat have been deleted since the last release..LPNow generate the new List page entries for the section into.L List.add :.LS 4\&../bin/getNAME -ip `cat FILES.add` > List.addvi List.add.LEVerify that the entries are correct!Again, search for filenames which contain`.' (dot) characters..LPCheck out the current List file from.SM SCCS :.LS 4sccs edit List.\fIsection\fP.LEBefore deleting any lines of.L List. "\fIsection\fP,"make sure the right deletions will be performed.Search.L List. \fIsection\fPfor occurrences of names in.L FILES.zapand redirect the output to .L List.zap :.LS 4fgrep -f FILES.zap List.\fIsection\fP > List.zapvi List.zap.LEMake sure that you want these lines deletedfrom.L List. \fIsection\fP!If there are lines which youdon'twant to delete,but they are comparatively few,you'll want to make the deletions from.L List. "\fIsection\fP ,"and merge back in any mistakenly deleted lines afterwards.It's therefore very important to preserve.L List.zap !.LPTo make the deletions,.LS 4vi List.\fIsection\fP.LEType:.LS 4!G.LEAt the prompt,type:.LS 4fgrep -v -f FILES.delete %.LEfollowed by.SM RETURN .If the file doesn't look right,you can always undo.Now,restore any mistakenly deleted lines from.L List.zapto.L List. \fIsection\fPand write the file.In general it's a good idea to keep records of any deletionsyou make,so keep.L List.zaparound,just to be safe..H 2 "Add New Entries".LPTo generate the new entries,position the cursor on the first line containing.L .zZ .Read in.L List.addat this point:.LS 4:r List.add.LESort the entries:.LS 4!G.LEAt the prompt,type:.LS 4sort.LEfollowed by.SM RETURN .The.L .firequest will be moved to beginning of the list.Be sure to return it to the end of the list where it belongs.If there are any capitalized entries,sort will place them at the top of the list.Move the capitalized entries to just after thecorresponding lower-case entries to restore the list todictionary order..LPIn sections 2 and 3,make sure that function names are followed by.L (\e|) ' `(parentheses separated by a half-space).To do this,use the substitution command.LS 4:%s/\e\efR/(\e\e|)&/.LEThe next steps in the process are updatingthe index for each section, and runninga final check on the formatting of allpages changed since the last release.These processes should happen concurrently..H C "Updating the Index \(em Phase One".LPIn order to update the index,you'll need to compile a list of man pageschanged since the last release.Then, you'll want to run off atrial index containing only referencesto those man pages, in order tocheck it for accuracy and completeness..H 2 "Get Lists of Pages Changed Since the Last Release".LP.L cdto the directory containing the sources for one of the sections.List the.L s.files for the man pages in the.SM SCCSdirectory using the long form and by modificationtime.Redirect the output to.L FILES.index :.LS 4ls -lt SCCS/s.* > FILES.indexvi FILES.index.LEFind the start of that part ofthe list bearing the date of the last release.Delete these and all entries below itby typing:.LS 4dG.LEin command mode(vi will not echo this).Now,in order to strip away all butthe desired filename from the file,type:.LS 4:%s/.*\e/s\e.//.LESort the resulting list by positioning thecursor on the first line of the file andtyping.LS 4!G.LEAt the prompt,type:.LS 4sort.LEfollowed by.SM RETURN .Write the file!The success of the succeedingsteps depends on this!.LPAt this point,you want to make sure that current versions of thefiles listed in.L FILES.indexare extant.To do this,type.SM CTRL-Zto suspend.L viand get a shell prompt.Get the files from.SM SCCS :.LS 4sccs get `cat FILES.index`.LEGo back into.L vi :.LS 4fg.LESince.L .sofiles do not contain indexing requests,you'll want to eliminate them from the list.Again position the cursor on the first lineof the file and type:.LS 4!G.LEAt the prompt,type:.LS 4grep -l NAME `cat %`.LEThis will replace the.L vibuffer with the names ofthose files in the list which contain.SM NAMElines..L % ' (`stands for the name of the file currently being edited,in this case,.L FILES.index .).LP Write the file and quit.L vi ..LP You now have a list of man pagesfor which the index entries must be checked..H 2 "Copy the Sources from the Release Machine".LPNow you need to get copies of the sources from the release machine:.LS 4cd /usr/src/man/man\fIsection\fP.LEOn your own machine:.LS 4cd \fIyour-home-directory\fPmkdir index.pages.LEGo back to the release machine:.LS 4foreach i (man1 man2 man3 man4 man5 man6 man7 man8)cd $ircp `cat FILES.index` \fIyour-machine\fP:\fIyour-home-directory\fP/index.pagescd ..end.LEYou'll also need a copy of.L FILES.indexon your own machine.Rather than copying it from the release machine,you can do it more easily:.LS 4cd \fIyour-home-directory\fP/index.pagesls > FILES.indexvi FILES.index.LERemove.L FILES.index '' ``itself from the list..H 2 "Generate a Trial Index".LPNow generate a trial index:.LS 4make -f Printfile trial.index.LEThis invokes the.L trial.indextarget in.L Printfile ,which generates the file.L trial.index ..LPIn order to preview this file,you must copy it from the release machineto your own machine:.LS 4rcp trial.index \fIyour-machine\fP:/tmp/trial.index.\fIsection\fP.LENow for the fun part:.LS 4preview /tmp/trial.index.\fIsection\fP.LEThis will display the formatted trial indexon the screen..H C "Reviewing Page Formatting".H 2 "Print Out the Pages Changed Since the Last Release".LPGo back to the release machine and print outthe man pages listed in.L FILES.index:.LS 4(troff -Tlw -msunman `cat FILES.index`) >& /dev/null &.LE.H 2 "Make Fixes".LPProofread them and make additional indexentries and corrections:.LS 4vi `cat FILES.index`.LE.H 2 "Merge in the Changes".LPIn order to this operation,you must have the man pages mounted from the release machine(typically on.L /usr/src/manor.L /usr/man )This is to ensure that you are comparing your versions of the pagesagainst the versions that you originally copied..LPCreate a destination directory where.L filemergecan store the merged versions of the files:.LS 4cd \fIyour-home-directory\fP/index.pagesmkdir pages.merged.LENow extract from.L FILES.indexseparate lists for each section of pages changed since the last release:.LS 4foreach i (1 2 3 4 5 6 7 8)grep "\.$i" FILES.index > FILES.index.$iend.LEYou're now ready to run.L filemerge:.LS 4filemerge -b -l FILES.index.\fIsection\fP . /usr/src/man/man\fIsection\fP pages.merged.LERepeat the process for each section..LPNote:If you've made many changes to a file,.L filemerge
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -