[comp.windows.x] Caution, study first hunk when applying patches to X11 files.

paulsh@shark.gwd.tek.COM (12/21/87)

This CAUTION is intended for those who are applying patches to X11 files.

If you have checked in the original files as the "initial version" on your
local host, then your RCS strings like $HEADER$ are different from those
being patched at MIT.  This is also the case if you have made any local
modifications of a file.  This usually causes the first hunk to fail.
Checking the <file>.rej will show what hunks failed and what was different
between the MIT original file and the MIT patched file.  If it is only RCS
stings that are affected, then you can ignore the failed hunk.  

Again in this scenario the first hunk may fail, but it is usually due
only to RCS stings and can be ignored.  However sometimes the first hunk
contains RCS stings AND other changes that need to be incorporated.
Therefore I caution implementors from getting into the habit of ignoring 
a failed first hunk.

*****  ALWAYS check the <file>.rej after patching to be sure  *****
*****  that any failed hunks are due only to RCS stings!      *****

In the last set of fixes, fix 82 and 86 have first hunks that include
additional changes besides the changed RCS strings.  Therefore in the scenario
above, to apply the fix you can modify the patch to delete the RCS
string changes but keep the other changes that need to be incorporated.

To summarize, Don't blindly ignore a failed first hunk!

Hope this helps.

Paul Shearer
M.S. 61-277
Tektronix, Inc.
P.O. Box 1000
Wilsonville, OR
	 97070-1000

W (503) 685-2137
tektronix!shark!paulsh

wohler@milk1.istc.sri.com..istc.sri.com (Bill Wohler) (12/22/87)

paulsh@shark.gwd.tek.COM writes:
>
>To summarize, Don't blindly ignore a failed first hunk!

  thanks for the warning paul.

  in addition, i would like to add that patch #60 had a shar archive
  contained within it that patch (and i) had ignored.  i usually run
  patch on the whole FIXES file, but after discovering this, i now
  grep for "/bin/sh" in the archive.  a warning about FIXES files that 
  have any non-diffs in them should be announced to xpert.

						--bw