Applying Patches to TinyMUSH 2.2.3

This page contains basic instructions for the non-developer who wants to apply a patch to a TinyMUSH 2.2.3 distribution. If you're an experienced developer, you can skip down to the summary.

If you're using a different version of TinyMUSH, these patches may not work!


The Dirty Details

To apply patches, cd to the tinymush-2.2.3 directory (where you run your make command) and run the command "patch <patchfile" followed by "make; make install".

Some patches may need you to cd down to the src directory instead of the distribution root. I'll note these where needed. Basically, patch figures out where the files live by itself, but if it can't, it will ask you for "Filename:". Either tell it the path, or kill patch, cd to the subdirectory, and try again.


Patch

Patch is a nifty program written by Larry Wall, the same fellow who invented Perl.

Patch reads files containing "context diffs" (a unix developers' term) and uses them to both identify the source files that need to be changed, as well as the changes themselves. It's even RCS-aware, which is the mode I use it in.

The simplest way to run Patch is to cd down into the subdirectory where the source files live and enter the command:

patch <patchfile
where "patchfile" is the name of the file you saved the patch into when you acquired it.

Under normal conditions, Patch renames your original source file "blah.c" to "blah.c.orig" and writes the new version right back into "blah.c". If patch has any problems reading the patch file, it will write the problem areas into a file like "blah.c.rej" for you to look at. It may or may not have made any changes to the actual "blah.c" file if it had trouble with the patch file.

Sometimes Patch will be able to make one change, but not another, resulting in a partial application of the patch. If this happens, I manually remove the changed "blah.c" and rename the "blah.c.orig" back to "blah.c", correct the problem (almost always a damaged patchfile!) and retry.

Once patch runs with no errors, you can proceed immediately to "make", assuming you've already built the server at least once before and still have your configuration information lying around. If you don't, you'll have trouble building again and will need to start the build from scratch with "./configure" and so on. See the Distribution's install instructions for details on this.

Patch is smart enough to spot when source files are under RCS control. It will refuse to alter source files you've checked out yourself. It will also automatically check out fresh copies of files it can see are available in RCS. If you don't use RCS, don't sweat it, but see below.

TinyMUSH's distribution unpacks all the source files in /src/ flagged as read-only, so if you aren't using RCS, Patch will stop and tell you to make the files writeable. Say you're applying the mini patch, which needs to write changes to look.c and functions.c. To make these files writeable, use the command:

cd src
chmod +w look.c functions.c
cd ..

It's up to you if you want to undo this after the new server is up and you're happy with the patch. That command is:

cd src
chmod -w look.c functions.c
cd ..

Summary

Here is a summary of steps I take myself when applying a patch to my own server. Assume I'm applying sprof.patch, and the game lives in /usr/local/etc/mush3.
  1. FTP a patch, or otherwise acquire one in a safe manner.
  2. Optional: inspect the patch to see what files it will alter, and make sure those files are writable. If they are read-only, and you're not using RCS to manage your changes like I am, Patch will Croak.
  3. cd /usr/local/src/tinymush-2.2.3
  4. patch <sprof.patch
  5. make
  6. cd /usr/local/etc/mush3
  7. (Connect to the running mush and @shutdown)
  8. ./Backup
  9. cp netmush netmush.(date)
  10. cd /usr/local/src/tinymush-2.2.3
  11. make install
  12. cd /usr/local/etc/mush3
  13. ./Startmush
  14. Test the patch.
  15. Optional: Check the altered source files back into RCS.
  16. Copy the patch file to a safe place for future re-use and viewing.

I like to make backup copies of the database and the original binary. Call me paranoid.


Frames Homepage Non-Frames Homepage

Say no to monopolies, BOYCOTT MICROSOFT!
KMFMS, one of the Angry Penguins.
[U.S. Flag] In memory of those who died Sept. 11, 2001 at the World Trade Center, the Pentagon, and on American Airlines Flight 11, United Airlines Flight 175, American Airlines Flight 77, and United Airlines Flight 93
Honoring Marsh & McLennan professionals I've worked with, including:
Jack Aron, Valerie Hanna, Joe Sisolak, Greg Reda, and Cathy Fagan.
Shattered Photoessay by James Nachtewy


Comments may be sent to gyles19@nospam.visi.com

This page last updated Sunday, 17-May-1998 22:19:03 CDT.