home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / howpatch.txt
Encoding:
Text File  |  1996-08-25  |  7.9 KB  |  174 lines

  1. This CD includes many Quake-Patchfiles, which can be found in the 
  2. directory \quake\programs.
  3.  
  4. How to use and make QuakeC patch files
  5. by Jeff Epler <jepler@inetnebr.com>
  6. 3 August 1996
  7.  
  8. This is a draft, and probably isn't that great an explanation. 
  9.  
  10. Some parts of this document were contributed by Kyle R. Hofmann
  11. <rhofmann@crl.com>, and various other changes were also suggested via email.
  12.  
  13. You should always be able to find the newest version of this
  14. document at http://cse.unl.edu/~jepler/quakec/howpatch.txt.  If I
  15. take the time to make a hypertext version of this file, it will be at
  16. http://cse.unl.edu/~jepler/quakec/howpatch.html.  This file is also
  17. uploaded to ftp.cdrom.com.
  18.  
  19. How to use QuakeC patch files
  20. -----------------------------
  21.  
  22.    Get and install a version of patch suitable for your OS.  Under most
  23.    unicies, (including Linux) this is already available.  For DOS, you
  24.    want
  25.     ftp://oak.oakland.edu/pub/simtelnet/gnu/djgpp/v2gnu/pat21b.zip
  26.     ftp://ftp.simtelnet.com/pub/simtelnet/gnu/djgpp/v2gnu/pat21b.zip
  27.    I don't know where a windows 95/nt version of patch resides, but the
  28.    DOS version should execute just fine.  If you want to compile your own
  29.    version of patch, get it from
  30.      ftp://prep.ai.mit.edu/pub/gnu/diffutils-2.7.tar.gz
  31.  
  32.    Get a version of qcc suitable for your OS.  Look around at
  33.     ftp://ftp.cdrom.com/pub/idgames/idstuff/source or
  34.     ftp://ftp.cdrom.com/pub/idgames2/quakec or
  35.     ftp://ftp.cdrom.com/pub/idgames2/utils for one.
  36.  
  37.     A qcc-Version for Win'95 and WinNT is included on this CD. You can find
  38.     it in the directory \quake\programs\WCCWIN32    
  39.  
  40.    Get a patch file.  
  41.  
  42.    Put the patch.exe and qccdos.exe files in a directory in your PATH.
  43.  
  44.    Make a new directory and copy the unchanged files from v101qc to this
  45.    new directory.  Change to the new directory.  Unzip the patch file
  46.    (friend.zip) here, or move it from where you unzipped it. (If you are
  47.    smart or willing to spend much time, you can add several patches to
  48.    the same source, getting all the features.  However, there are likely
  49.    to be rejects [see below] or unwanted side effects of putting several
  50.    patches together)
  51.  
  52.      patch < friend.pat or
  53.      type friend.pat | patch
  54.  
  55.    Inspect the directory for any "rejected" patches.  If there are some,
  56.    you should use your favorite editor to inspect the reject file (named
  57.    under unix whatever.qc.rej, and under DOS whatever.qc#) and make by
  58.    hand the changes that are required.  + marks lines present in the
  59.    new version but not in the old, and - marks lines present in the old
  60.    but not in the new.  Ideally, you should have no rejected patches.
  61.    If you have many rejected patches, your command-line may have been
  62.    wrong for patch.  Files ending in ~ are backups of files changed by the
  63.    patch, and can generally be deleted.
  64.  
  65.    Run qcc to compile a new progs.dat (depending on the setup, progs.dat
  66.    may be created in the current directory or the parent directory.
  67.    Change the first line in progs.src to move where progs.dat will be
  68.    created), copy it to quake\whatever, and run quake -game whatever.
  69.    You're done.
  70.  
  71.    To undo a patch, use the command
  72.  
  73.      patch -R < friend.pat
  74.  
  75.    Make sure you type an uppercase R.
  76.  
  77. Errors installing QuakeC patches
  78. --------------------------------
  79.  
  80.   patch is not a perfect utility.  If the QuakeC source which you are
  81. trying to patch is already modified, or if the file has had lines added
  82. or subtracted to it, you may get errors.  In serious cases, you may get
  83. "rejected hunks", patches which could not be applied at all.  Warning and
  84. errors include:
  85.  
  86.   - Offsets.  Offsets are nothing much to be concerned about, usually.
  87.     They indicate that patch did not place the patch on the exact line
  88.     specified; instead, patch placed the patch several lines away.  This
  89.     is usually indicative of previously changed QuakeC sources, and in
  90.     most cases may be safely ignored.  However, if there is an
  91.     excessively large offset, you should check to make sure the patch has
  92.     been applied properly.
  93.  
  94.   - Fuzz factor.  Fuzz factor indicates that the exact context could not
  95.     be found, and so context lines at the beginning or end of the patch
  96.     were ignored.  Be suspicious of patches which have a fuzz factor.
  97.     Though they may be a result of changed sources, they can also be a
  98.     result of an improperly applied or created patch.  Be sure to check
  99.     to ensure that the patch is properly applied.
  100.  
  101.   - Rejected hunks.  Rejected hunks are sections of a patch which could
  102.     not be applied at all.  They will be named foo.qc.rej or foo.qc#
  103.     (replace foo with the filename of the .qc file which could not be
  104.     patched).  They may be hand applied by going to the lines specified
  105.     at the start of the hunk and the entire hunk being copied in.  If the
  106.     hunk is part of a context diff, be sure to install the second half;
  107.     that's the changed version (you can use the first half of the hunk
  108.     to determine where the patch should be applied).  If the hunk is part
  109.     of a unified diff, be sure to remove the sections with as - prefixing
  110.     them and remove the + prefixing other lines (but do not remove the
  111.     lines with the +'s)  However, be *extremely careful* --- rejected
  112.     hunks may be completely incompatible with the code you currently have
  113.     installed.
  114.  
  115. Installing multiple patch files
  116. -------------------------------
  117.  
  118.    Installing multiple patch files is easy and simple.  Simply get both
  119.    patches, and install them using the procedure listed above.  You will
  120.    most likely encounter some of the errors listed above.  In this case, do
  121.    not worry if it's simply a case of a minor offset.  Most likely the file
  122.    has been modified by both patches and you're seeing a side effect.  Worry
  123.    more if a fuzz factor is needed; it might indicate that the same portion
  124.    of code is being modified by two patches.  Worry most when a hunk is
  125.    rejected --- that usually indicates that the exact same portion of code
  126.    was modified by both patches.  It might make the two incompatible.
  127.  
  128.  
  129. How to make QuakeC patch files
  130. ------------------------------
  131.  
  132.    Get and install a copy of diff for your machine.  For unix, again it's
  133.    included.  For DOS, get
  134.     ftp://oak.oakland.edu/pub/simtelnet/gnu/djgpp/v2gnu/dif271b.zip
  135.     ftp://ftp.simtelnet.com/pub/simtelnet/gnu/djgpp/v2gnu/dif271b.zip
  136.    Again, I don't know about w95/w32/wnt, except that the dos version
  137.    should work in the dos box.
  138.  
  139.    Get a directory with your mods in it and a directory with v101qc source
  140.    side by side.
  141.  
  142.    diff -ur --new-file v101qc yourdir > yourdir.pat
  143.  
  144.    zip or otherwise compress yourdir.pat
  145.  
  146.    Share with the world.
  147.  
  148.    You should probably always diff against v101qc sources unless you have
  149.    a good reason not to.  When you diff against v101qc, anyone can use
  150.    those files and your .pat file to get a replica of your sources.  One
  151.    time to use a different set of 'old' files would be something like this:
  152.  
  153.      John Doe made code for a weapon that turned monsters into little dogs.
  154.      The only problem is that his files don't quite work -- Ammo can be
  155.      turned into a dog too.  You fix this up and want to let John know.  So
  156.      you make a diff like this:
  157.  
  158.      diff -ur --new-file jdgun yourgun > yourgun.pat
  159.  
  160.      Now, John Doe can see the differences between his gun code and your
  161.      gun code, and as a bonus the file is smaller.  You could also hand it
  162.      out to people who have his original gun diff as well.
  163.  
  164. Other problems
  165. --------------
  166.  
  167. If you get an error about being unable to create a file /tmp/paaaax
  168. (For instance), just create a \TMP directory on the drive where you were
  169. trying to run patch.  I don't know if having the TEMP or TMP environment
  170. variable set to an existing directory will also help this.
  171.  
  172. If you get an error about DPMI, copy cwsdpmi.exe from the quake directory 
  173. onto your path.
  174.