Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!cit-vax!elroy!smeagol!earle From: earle@smeagol.UUCP Newsgroups: comp.emacs Subject: Re: How are diff files used to update the distribution ? Message-ID: <796@smeagol.JPL.NASA.GOV> Date: Tue, 27-Jan-87 22:21:58 EST Article-I.D.: smeagol.796 Posted: Tue Jan 27 22:21:58 1987 Date-Received: Thu, 29-Jan-87 03:51:43 EST References: <8701192041.AA01426@EDDIE.MIT.EDU> <1128@steinmetz.steinmetz.UUCP> Sender: root@smeagol.JPL.NASA.GOV Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 86 Keywords: patch, GNU Emacs updates Summary: Step 2 is not necessary ; Step 4 is wrong ; needs a Step 4.5 :-) In article <1128@steinmetz.steinmetz.UUCP>, montnaro@sprite.UUCP writes: > In article SKAPUR@sbccmail.BITNET (Sanjay Kapur) writes: >>I copied version 18.33 of Gnu-emacs last month. >>I now also have the diff file diff-18.33-18.35. >>How can I use the diff file to update the 18.33 version to 18.35 ? > > 1. cd to the directory containing the GNU Emacs "dist" directory. > > 2. create the following symbolic links: > > ln -s dist dist-18.33 > ln -s dist dist-18.35 This is not necessary. Just go to the top level Emacs directory in your filesystem heirarchy. See note after #4. > 3. Check the beginning of diff-18.33-18.35 for any instructions. Create any > new files given (they will be at the beginning of the diff file). Trim the > instructions and any new files from the beginning of the diff file. You > don't strictly have to do this, but it speeds up patch's first patch > enormously. An easy way to do this is to search-forward for '=====', since a line of = divides each new/replacement file. When you get to the line, either write down the name of the file or grab it if you have a mouse based system (like a Sun). Then delete all the lines in the buffer up to and including the line you just found with '====='. Then search for the next occurance of that line; when it reaches there go back one line and tell the editor to write out all lines from 1 to point to the named file that you saved/grabbed. Repeat this cycle (get file name, delete from line 1 to line with file name, go find next line with '=====', write lines 1 to (line-w/-=== - 1)) until you have reached the beginning of the `diff' section; then you can nuke lines 1 to point again. This just leaves the diffs remaining; as Skip says, this helps `patch' start up faster. Note that using `vi' (heresie!) for this kind of "quick-hit" editting *loses* because `vi' can't handle long lines of input and Emacs can. This will bite you on the diffs file for 18.35-18.36! > 4. execute > patch -p < diff-18.33-18.35 No; if you invoke as patch -c -p1 < diff-file `patch' will skip past the `dist-18.xx/' in the diffs and get to the pathnames relative to where you are now. This makes step 2. unnecessary if you have done step 1. > Patch will spit out lots of messages. You will want to keep an eye on things > for "Hunk failed" messages. In particular, unless the constant emacs-version > in dist/lisp/version.el is "18.33.0" that particular patch will fail. No big > deal, just edit version.el and set emacs-version to "18.35.0". It is easier to edit `lisp/version.el' *before* running `patch'; since every `diff' file is between versions, one can guarantee that version.el will be patched and therefore the patch will always fail if you do not `reset' it to the original distributed version ahead of time! > Other failed hunks will turn up in whatever-file.type.rej (i.e., > version.el.rej) for the previous example. If you have made local changes it > is possible that they will conflict with the distributed changes. At any > rate, you will have to compare the source file with the diff output in the > .rej file manually and figure out what the problem is. There are usually few > problems. > > When a file is successfully patched, the original will be moved to > whatever-file.type.orig and the new one placed in whatever-file.type. > > 5. Remake emacs. AUUGGH! No! 4.5. Run your present Emacs in the `lisp' subdirectory; execute M-x byte-recompile-directory to make new .elc files from the updated/new .el files. THEN you can rebuild Emacs. Also, you should remove the .orig files from {src,lisp,etc,wherever} if all the patches installed correctly. Before rebuilding Emacs, if you keep versions of the distribution on mag tape (as I do), you can do a `make clean' in each of the subdirectories to remove executables and .o files and the like, and then tar/cpio/whathaveyou to tape. Then you can rebuild Emacs & friends. -- Greg Earle UUCP: sdcrdcf!smeagol!earle; attmail!earle JPL ARPA: elroy!smeagol!earle@csvax.caltech.edu AT&T: +1 818 354 4034 earle@jplpub1.jpl.nasa.gov (For the daring) Should I start with the time I SWITCHED personalities with a BEATNIK hair stylist or my failure to refer five TEENAGERS to a good OCULIST?