Here's what I have:
1) A fresh copy of the Nethack source code.
2) The Visual Studio 2008 patch file from nethack.org.
3) A copy of patch.exe from the DJGPP FTP site. (patch version 2.5.9
or something like that).
In excruciating detail, how do I apply the patch?
I've basically tried this: patch -pX < VisualStudio2008patch.txt
(where X is 0, 1, 2, 3...)
The --help isn't very --helpful.
The best I can do is something like this (I think this was -p0), but
there are lots of "fails" in there.
What am I doing wrong? Thanks!
Adman
-----------
patching file include/config1.h
patching file include/ntconf.h
Hunk #1 succeeded at 65 with fuzz 1.
Hunk #2 FAILED at 122.
Hunk #3 FAILED at 137.
Hunk #4 FAILED at 208.
3 out of 4 hunks FAILED -- saving rejects to file include/ntconf.h.rej
patching file include/tradstdc.h
Hunk #1 succeeded at 183 with fuzz 1.
patching file src/cmd.c
Hunk #1 succeeded at 160 with fuzz 2.
Hunk #2 FAILED at 284.
Hunk #3 FAILED at 300.
Hunk #4 succeeded at 446 with fuzz 2.
Hunk #5 succeeded at 476 with fuzz 2.
Hunk #6 FAILED at 497.
Hunk #7 succeeded at 513 with fuzz 2.
Hunk #8 succeeded at 522 with fuzz 2.
Hunk #9 succeeded at 544 with fuzz 2.
Hunk #10 succeeded at 553 with fuzz 2.
Hunk #11 succeeded at 562 with fuzz 2.
Hunk #12 succeeded at 571 with fuzz 2.
Hunk #15 succeeded at 630 with fuzz 2.
Hunk #17 succeeded at 647 with fuzz 2.
Hunk #18 succeeded at 689 with fuzz 2.
Hunk #19 succeeded at 726 with fuzz 2.
Hunk #20 succeeded at 1231 with fuzz 2.
Hunk #21 succeeded at 1244 with fuzz 2.
Hunk #22 FAILED at 1982.
Hunk #23 succeeded at 2448 with fuzz 2.
4 out of 23 hunks FAILED -- saving rejects to file src/cmd.c.rej
patching file src/dig.c
Hunk #1 succeeded at 207 with fuzz 2.
patching file src/dlb.c
Hunk #1 succeeded at 229 with fuzz 2.
patching file src/do.c
Hunk #1 succeeded at 1597 with fuzz 2.
patching file src/do_wear.c
Hunk #1 succeeded at 92 with fuzz 1.
Hunk #3 succeeded at 193 with fuzz 1.
Hunk #5 succeeded at 290 with fuzz 1.
Hunk #7 succeeded at 390 with fuzz 1.
Hunk #8 succeeded at 415 with fuzz 1.
Hunk #13 succeeded at 548 with fuzz 1.
Hunk #14 succeeded at 1929 with fuzz 2.
patching file src/eat.c
Hunk #1 FAILED at 178.
Hunk #2 FAILED at 395.
Hunk #3 FAILED at 1013.
Hunk #4 FAILED at 1189.
Hunk #5 succeeded at 2222 with fuzz 2.
4 out of 5 hunks FAILED -- saving rejects to file src/eat.c.rej
patching file src/lock.c
Hunk #1 FAILED at 73.
Hunk #2 FAILED at 128.
2 out of 2 hunks FAILED -- saving rejects to file src/lock.c.rej
patching file src/region.c
Hunk #1 FAILED at 714.
1 out of 1 hunk FAILED -- saving rejects to file src/region.c.rej
patching file src/spell.c
Hunk #1 succeeded at 313 with fuzz 2.
patching file src/steal.c
Hunk #1 succeeded at 143 with fuzz 2.
patching file sys/share/uudecode.c
Hunk #1 FAILED at 37.
Hunk #2 FAILED at 196.
2 out of 2 hunks FAILED -- saving rejects to file sys/share/
uudecode.c.rej
patching file sys/winnt/install.nt
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 21.
Hunk #3 FAILED at 36.
Hunk #4 FAILED at 50.
Hunk #6 FAILED at 101.
Hunk #7 FAILED at 125.
Hunk #9 FAILED at 309.
Hunk #10 FAILED at 325.
Hunk #11 FAILED at 378.
Hunk #12 succeeded at 440 with fuzz 2.
9 out of 12 hunks FAILED -- saving rejects to file sys/winnt/
install.nt.rej
patching file sys/winnt/Makefile.msc
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 115 with fuzz 1.
Hunk #3 FAILED at 182.
Hunk #4 FAILED at 253.
Hunk #5 FAILED at 280.
Hunk #6 FAILED at 300.
Hunk #7 FAILED at 308.
Hunk #8 FAILED at 503.
Hunk #9 FAILED at 603.
Hunk #10 FAILED at 626.
Hunk #11 FAILED at 641.
Hunk #12 FAILED at 656.
Hunk #13 FAILED at 669.
Hunk #14 FAILED at 709.
Hunk #15 FAILED at 763.
Hunk #16 FAILED at 822.
Hunk #17 FAILED at 917.
Hunk #18 FAILED at 925.
Hunk #19 FAILED at 963.
Hunk #20 FAILED at 977.
Hunk #21 FAILED at 1009.
Hunk #22 FAILED at 1018.
Hunk #23 FAILED at 1027.
Hunk #24 FAILED at 1049.
Hunk #25 FAILED at 1057.
Hunk #26 FAILED at 1095.
Hunk #27 FAILED at 1121.
Hunk #28 FAILED at 1131.
Hunk #29 FAILED at 1176.
Hunk #30 FAILED at 1205.
29 out of 30 hunks FAILED -- saving rejects to file sys/winnt/
Makefile.msc.rej
patching file sys/winnt/nhsetup.bat
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 54.
2 out of 2 hunks FAILED -- saving rejects to file sys/winnt/
nhsetup.bat.rej
patching file util/makedefs.c
Hunk #1 FAILED at 543.
Hunk #2 FAILED at 563.
2 out of 2 hunks FAILED -- saving rejects to file util/makedefs.c.rej
patching file win/win32/winms.h
patching file win/win32/NetHack.sln
patching file win/win32/dgncomp.vcproj
patching file win/win32/dgnstuff.vcproj
patching file win/win32/dlb_main.vcproj
patching file win/win32/levcomp.vcproj
patching file win/win32/levstuff.vcproj
patching file win/win32/makedefs.vcproj
patching file win/win32/NetHackW.vcproj
patching file win/win32/recover.vcproj
patching file win/win32/tile2bmp.vcproj
patching file win/win32/tilemap.vcproj
patching file win/win32/tiles.vcproj
patching file win/win32/uudecode.vcproj
-------
How many patches do you already have on your NetHack version?
Thanks for your response!
I have not applied any patches. I have a freshly downloaded copy of
the Nethack 3.4.3 source. Every time I've tried to apply the patch, I
try it against a pristine, fresh copy. If I get partial successes, or
what to try again, I blow everything out and re-extract the pristine
copy again.
Adam
And again, if it wasn't obvious, this is under Windows XP.
> Ok, this is killing me.
>
> Here's what I have:
>
> 1) A fresh copy of the Nethack source code.
Version 3.4.3?
> 2) The Visual Studio 2008 patch file from nethack.org.
> 3) A copy of patch.exe from the DJGPP FTP site. (patch version 2.5.9
> or something like that).
>
> In excruciating detail, how do I apply the patch?
>
> I've basically tried this: patch -pX < VisualStudio2008patch.txt
> (where X is 0, 1, 2, 3...)
>
I get vs2008.txt for a file name.
I've never had to use anything but patch -p0 <sourcefile
> The --help isn't very --helpful.
>
You want to read the manual page. You can find any linux core man page at
gnu.org.
> The best I can do is something like this (I think this was -p0), but
> there are lots of "fails" in there.
>
> What am I doing wrong? Thanks!
It says in the patch to run the nhsetup batch file *after* applying the
patch.
The only other thing I can think is running it under bash instead of MS's
now screwed up dos shell. Alternatively try dosbox, but patch *is*
designed for to run under djgpp which involves bash. There are subtle
differences in the way the two command interpreters work with files that
can affect such things.
Yes.
> I get vs2008.txt for a file name.
Right. I copied the patch into my own text file. I wonder if that's
the hole...
> I've never had to use anything but patch -p0 <sourcefile
What OS are you using? Windows XP, for example, doesn't come with
it's own "patch" tool (that I know of).
> It says in the patch to run the nhsetup batch file *after* applying the
> patch.
Yes, of course. I haven't run nhsetup yet. I was saving that (as you
and the patch say) until I was sure the patch applied correctly.
> The only other thing I can think is running it under bash instead of MS's
> now screwed up dos shell. Alternatively try dosbox, but patch *is*
> designed for to run under djgpp which involves bash. There are subtle
> differences in the way the two command interpreters work with files that
> can affect such things.
Tried DosBox and Win-Bash (bash shell for windows). Same errors. Why
is MS's dos shell screwed up?
Ok, I've just gone to the Nethack Patch database, and downloaded some
other patch files, and they appear to work just fine. (Tried
"priest.diff", the coin flip one, and brewing). I noticed, though,
that the format of those patches is different than the Visual Studio
patch.
Note the difference between this (which works)
--- nethack-3.4.3\src\role.c 2003-12-07 16:39:14.000000000 -0700
+++ priest-343\src\role.c 2009-10-16 12:24:10.841225600 -0600
@@ -196,7 +196,7 @@
PM_ARCH_PRIEST, PM_ACOLYTE, PM_NALZOK,
PM_HUMAN_ZOMBIE, PM_WRAITH, S_ZOMBIE, S_WRAITH,
ART_MITRE_OF_HOLINESS,
- MH_HUMAN|MH_ELF | ROLE_MALE|ROLE_FEMALE |
+ MH_HUMAN|MH_ELF|MH_ORC|MH_DWARF|MH_GNOME | ROLE_MALE|ROLE_FEMALE |
ROLE_LAWFUL|ROLE_NEUTRAL|ROLE_CHAOTIC,
/* Str Int Wis Dex Con Cha */
{ 7, 7, 10, 7, 7, 7 },
And this, which sometimes works, sometimes doesnt:
*** ../nethack-3.4.3/include/config1.h Sun Dec 09 08:46:13 2007
--- include/config1.h Sun Dec 09 09:29:40 2007
***************
*** 115,120 ****
--- 115,124 ----
# endif
#endif
+ #if defined(_WIN32) && !defined(WIN32)
+ #define WIN32
+ #endif
+
#ifdef WIN32
# undef UNIX
# undef MSDOS
In short, I don't think the version of "patch" that I have likes the
input file format for the Visual Studio 2008 patch. Any further
thoughts?
Thanks for your help. If you've done this under Windows XP and can
point me to where you got your patch utility, I'd appreciate it!
Adam
I've isolated one of the failed hunks. It's a very simple change to
src/eat.c. When I try to patch this, it fails. No idea why.
*sigh*
Hasn't anyone in the history of the world ever patched Nethack under
Windows?
*** ../nethack-3.4.3/src/eat.c Sun Dec 09 08:46:13 2007
--- src/eat.c Sun Dec 09 09:29:41 2007
***************
*** 178,184 ****
STATIC_PTR
int
! eatmdone() /* called after mimicing is over */
{
/* release `eatmbuf' */
if (eatmbuf) {
--- 178,184 ----
STATIC_PTR
int
! eatmdone(VOID_ARGS) /* called after mimicing is over */
{
/* release `eatmbuf' */
if (eatmbuf) {
I'd guess it's a whitespace issue; see if the patch.exe has a
command-line option to ignore differences in whitespace.
--
Pasi Kallinen
pa...@alt.org
http://bilious.homelinux.org/ -- NetHack Patch Database
Thanks. Sorry for all the bother. :)
Adam
> Ok, a little more. I now understand context vs. unified diff files.
>
> I've isolated one of the failed hunks. It's a very simple change to
> src/eat.c. When I try to patch this, it fails. No idea why.
>
> *sigh*
>
> Hasn't anyone in the history of the world ever patched Nethack under
> Windows?
>
Yes, plenty. I would send a message to the people who created the diff
file. The most successful method of patching nethack is to use gcc and the
ansii version of nethack. That would be to use djgpp exclusively in the
microsoft world and to use what comes install with linux.
The snipped portion I'm not even going to try to figure out why it didn't
work. I recall hardly anything about diff.
>> > 1) �A fresh copy of the Nethack source code.
>> Version 3.4.3?
>
> Yes.
>
>> I get vs2008.txt for a file name.
>
> Right. I copied the patch into my own text file. I wonder if that's
> the hole...
>
>> I've never had to use anything but patch -p0 <sourcefile
>
> What OS are you using? Windows XP, for example, doesn't come with
> it's own "patch" tool (that I know of).
>
Doesn't matter. Patch is a unix utility, but you're running the version
compiled for dos with the memory extender. The same exact command with the
same exact command line options.
>> It says in the patch to run the nhsetup batch file *after* applying the
>> patch.
>
> Yes, of course. I haven't run nhsetup yet. I was saving that (as you
> and the patch say) until I was sure the patch applied correctly.
>
>> The only other thing I can think is running it under bash instead of
>> MS's now screwed up dos shell. Alternatively try dosbox, but patch *is*
>> designed for to run under djgpp which involves bash. There are subtle
>> differences in the way the two command interpreters work with files
>> that can affect such things.
>
> Tried DosBox and Win-Bash (bash shell for windows). Same errors. Why
> is MS's dos shell screwed up?
>
Not exactly sure, but it has never worked as it should since windows 95.
MS has a wierd way of handling backwards compatibility and threading.
Sorry, But I'll never run a consumer or install protected MS OS after
98SE again. The *only* free source of patch is the one you have. If you
got patch from delorie.org (going from memory here) where they have djgpp,
the only other reliable source I know of is gnu.org. You want the zip file.
The tar.gz is the source code. That applies to all gnu utilities. You did
install djgpp properly right? That is *exactly* as it says in the readme.
You should also have a manual page. Probably called patch.1 or patch.txt
possibly. patch files are generated by diff which compares two source
directory trees to each other.