Re: [SLUG] [PIG] me vs Borland

From: Paul M Foster (paulf@quillandmouse.com)
Date: Tue Jun 06 2006 - 00:35:01 EDT


Eben King wrote:
> On Mon, 5 Jun 2006, Paul M Foster wrote:
>
>> Eben King wrote:
>>
>>> I _thought_ you did it like this:
>>>
>>> eben@pc:~/word_docs/cis-4930_object-oriented-programming/projects/complex_borland$
>>> patch -p0 Complex.patch Complex-20060604-1131/Complex.cpp
>>> patch: **** Only garbage was found in the patch input.
>>
>> You should only need to give the name of the patch file on the command
>> line.
>
> Like this?
>
> eben@pc:~/word_docs/cis-4930_object-oriented-programming/projects/complex_borland$
> ls
> total 1.2M
> 4.0K bcc32.log 164K Complex.exe 4.0K
> input.txt
> 20K cartesian to polar conversion.doc 4.0K Complex.hpp 4.0K
> main.cpp
> 4.0K Command Prompt.lnk 4.0K Complex.hpp.old 164K
> main.exe
> 4.0K compile.bat 16K Complex.obj 12K
> main.obj
> 4.0K Complex-20060604-1131/ 4.0K Complex.patch 388K
> main.tds
> 8.0K Complex.cpp 388K Complex.tds
> 4.0K Complex.cpp.old 4.0K Copy of main.cpp
> eben@pc:~/word_docs/cis-4930_object-oriented-programming/projects/complex_borland$
> patch Complex.patch
>
> It waits as if it's expecting data on stdin when I do that. I killed
> that one with ^C. This errors out:
>

Called that way, I imagine it's looking for input on stdin.

> eben@pc:~/word_docs/cis-4930_object-oriented-programming/projects/complex_borland$
> patch < Complex.patch
> patching file Complex.cpp
> patch: **** malformed patch at line 12:
>

Almost. It would normally be called as:

patch -pn < patchfile

>
>> The number of subdirectories on the paths determines whether you give
>> it a -p0, -p1, etc. on the command line.
>
> So if it's expecting to find ./foo and instead you want it to look for
> ./bar/baz/foo you'd give it -p2 and tell it about the victim directory?
>

I looked back at the original patch file from Dylan's post, and it looks
like if you're going to call it in the directory where the original file
is, you'd say:

patch -p1 < Complex.patch

That would remove all the preceding slashes and give you just the
basenames of the files, which would work if you're in the directory of
the original file.

I am *not* an expert on the use of patch. Seems odd to me that patch is
erroring out on the content of the patch. I wonder if there truly is
something wacky about the interior of the patch, or it's in a format
patch doesn't understand or something. The lines starting with "diff" in
the patch file seem odd to me; I've never seen those inside a diff
before. I wonder if this is really three patches in one file.

I wish I could be more help. I just don't use patch very often. Anyway,
Dylan probably knows waaaay more about the use of patch than I do.

-- 
Paul M. Foster

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:03:56 EDT