Page 1 of 1

arggg.. how to *apply* patches in windows?

Posted: Sun Dec 29, 2002 10:51 pm
by michaelh20
Great I know how to make them, but I don't know how to apply them...

How does one actually apply the diff -u files to directories etc..?

This is windows I am speaking of.. I think the patch thing I was trying to use doesn't work.. perhaps I need a different version.

Posted: Sun Dec 29, 2002 11:03 pm
by Fiberchunks
look here, and see if this might help you...

http://www.codeproject.com/useritems/patch.asp

Although - had I to work with that lovely os, I would prob. just bite the bullet and grab cygwin, and related gnu tools (patch, etc.)

Anyway, that's all I could find, good luck!

Peace

Posted: Mon Dec 30, 2002 2:21 am
by michaelh20
I got it, I just didn't have the parameters right, plus my patch was also full of cr/lf I think too

so the right command if you are in the directory to be patched is
patch -p1 < silenceflagt.diff


Can someone explain what the -p1 is doing ?

simple answer..

Posted: Mon Dec 30, 2002 6:33 am
by Fiberchunks
-pX strips the leading number of slashes from the filename to be patched -- for example, given the file (in the patchfile or .diff):
/blah/foo/cruft/bogacious/froody

if you specify -p0 - the entire file is read as it /blah/foo ....

if you specify -p1 - the file : blah/foo.... (note the leading slash is gone).

and -p3

cruft/bogagcious/froody.

Here's an excerpt from the man page on my system, in case I mangled the above description:

-pnum or --strip=num
Strip the smallest prefix containing num leading slashes from each
file name found in the patch file. A sequence of one or more adja-
cent slashes is counted as a single slash. This controls how file
names found in the patch file are treated, in case you keep your
files in a different directory than the person who sent out the
patch.

Hope this helps.

Note that if you always patch from where the other person patched (in this case $HOME/bzflag/
then you should never need to specify anything but -p1

Peace

Posted: Wed Jun 18, 2003 6:08 am
by EvilChickenNugget
I'm trying to figure out how to apply a .diff file as a patch. I tried downloading the app in that link you gave, fiber, but it didn't work for the .diff file.

I'm on windows, of course

Posted: Wed Jun 18, 2003 7:05 am
by Fiberchunks
/me is no winderz guru -- I'm sure patlabor can help you out with it tho.

Posted: Wed Jun 18, 2003 2:55 pm
by JeffM
I got it to work right only once.

1) make sure the patch is a windows format text file ( none of those unix style line endings)

2) use this version of patch

the rest kinda depends on the patch

basicly you need to look at the patch and see what folder is was generated from.

most patches should go in the bzflag root dir, and then you specify -p0 in the patch line. but sometimes they are difrnet. sometimes you have to tell the patcher to ignore parts of the paths in the diff file. like if the patch was made to refrence /usr/bzflag/..... you would use -p1 to tell it to ignore the first dir in those paths.

other then that you kinda have to play with it. There isn't a standard way to make patches, so sometimes you even have to edit the patch file.

Posted: Wed Jun 18, 2003 8:02 pm
by EvilChickenNugget
Great, thanks. I'll give it a shot when I get home from work.

Posted: Sat Apr 24, 2004 3:06 pm
by Qweet
Hello everyone... I've had BZflag for alittle while now, its pretty awesome!!!! Anyhoo, I'm working on Windows XP, and I'm totally perplexed as to how I am supposed to install these patches! I have no idea what you guys are talking about! :S I want to install the lazarus flag because it sounds pretty sweet, but I really have no clue how. Could you help me out with some clear instructions (for someone with no Linux experience! :( )

Thanks!

Posted: Sat Apr 24, 2004 4:54 pm
by JeffM
qweet, the first thing you must have is a way to compile and build the game on windows. This means ether a copy of Visual C++ or the mingw compiler.

Once you have that, you will need to make sure you can compile the game. Then get the patch util from right up there. Throw it in your path, and apply the patch from the Command line like it's shown aboove, then re-compile the game.

Posted: Sat Apr 24, 2004 10:18 pm
by Qweet
I have visual studio.NET... I tried applying the lazarus.diff file, and i think 1 out of 9 Heaps were successful? :S and then I tried to compile, but got some errors. I'm fairly confused, lol... maybe I should try compiling without patching first. Any thoughts?

BTW thanks for the help (y)

Posted: Sun Apr 25, 2004 12:06 am
by JeffM
to apply a dif you want to make sure you apply it against the version it was made against. Check the docs on the diff and see what is was made with and get that. or go fix those problems. The code is allways changing.