1838727 Members
6858 Online
110129 Solutions
New Discussion

Re: Patch

 
Phil Daws_2
Regular Advisor

Patch

Hi:

I have a diff -c patchfile but when applying it I get the following problem :

# patch < ucd-hpux-patch
Hmm... Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** acconfig.h.SAV Sat Oct 6 03:01:41 2001
|--- acconfig.h Fri Oct 12 17:55:13 2001
--------------------------
Patching file acconfig.h using Plan A...
Hunk #1 succeeded at 304.
Hunk #2 succeeded at 312.
Hmm... The next patch looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** s/hpux.h.SAV Tue Jul 27 02:06:47 1999
|--- s/hpux.h Fri Nov 9 17:36:18 2001
--------------------------
File to patch:

How can I resolve this?
4 REPLIES 4
Steven Gillard_2
Honored Contributor

Re: Patch

As far as I can tell, those messages are purely informative - you will get them when using a context diff file (ie diff -c) as the patch file, but the files should still be changed correctly.

Is the patch correctly modifying the files you expect it to?

Regards,
Steve
harry d brown jr
Honored Contributor

Re: Patch

As long as you didn't receive a "failed" message, then you are OK.

live free or die
harry
Live Free or Die
Phil Daws_2
Regular Advisor

Re: Patch

But why does it ask me to enter a filename? If I copy and paste the filename it works fine.

P.
Steven Gillard_2
Honored Contributor

Re: Patch

Hmmm, according to the patch man page:

If no original file is specified on the command line, patch will try
to figure out from the leading garbage what the name of the file to
edit is. In the header of a context diff, the filename is found from
lines beginning with ``***'' or ``---'', with the shortest name of an
existing file winning.
:
If no filename can be intuited from
the leading garbage, you will be asked for the name of the file to
patch.

So it appears for some reason that patch can't find the s/hpux.h file, which is strange. Can you run a tusc trace on the patch command to find out where its looking for this file?

Regards,
Steve