2001-10-01 16:21:32

by Anthony

[permalink] [raw]
Subject: Patch files

Hi everyone,
I'm new to this list, and have been using Linux for just over a year now.
I'll get straight to the point, as I think this may be a bit off-topic. I'm
trying to apply a patch file to support a PCI printer card I've got. The
patch file contains several patches, but only the last one is working. I'm
prepared to try and sort it out myself, but I just need to know something
about the patch file so I might be able to understand how it works. Can
anyone please explain (or point me to the relevant documentation) to me
what the following lines mean?:

--- linux/include/linux/pci_ids.h.netmos Sat Sep 8 09:44:43 2001
+++ linux/include/linux/pci_ids.h Sat Sep 8 09:44:45 2001
@@ -1664,8 +1664,12 @@

And this is from further down in the patch:
@@ -2831,6 +2839,15 @@

I'm using RedHat 7.1 with the included 2.4.2-2 kernel. Any help on this
matter would be much appreciated.


----------------------------
Anthony ([email protected])
----------------------------


2001-10-01 16:32:41

by Tommy Reynolds

[permalink] [raw]
Subject: Re: Patch files

Anthony <[email protected]> was pleased to say:

> Hi everyone,
> I'm new to this list, and have been using Linux for just over a year now.
> I'll get straight to the point, as I think this may be a bit off-topic. I'm
> trying to apply a patch file to support a PCI printer card I've got. The
> patch file contains several patches, but only the last one is working. I'm
> prepared to try and sort it out myself, but I just need to know something
> about the patch file so I might be able to understand how it works. Can
> anyone please explain (or point me to the relevant documentation) to me
> what the following lines mean?:
>
> --- linux/include/linux/pci_ids.h.netmos Sat Sep 8 09:44:43 2001
> +++ linux/include/linux/pci_ids.h Sat Sep 8 09:44:45 2001
> @@ -1664,8 +1664,12 @@
>
> And this is from further down in the patch:
> @@ -2831,6 +2839,15 @@
>
> I'm using RedHat 7.1 with the included 2.4.2-2 kernel. Any help on this
> matter would be much appreciated.

Larry Wall's patch program uses the diff(1) program to perform the file
comparisons, so an "info diff" command is your friend. Hint: this is a context
diff.

---------------------------------------------+-----------------------------
Tommy Reynolds | mailto: <[email protected]>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.236.837.3839
Senior Software Developer | Mobile: +1.919.641.2923

2001-10-02 12:39:29

by James Lewis Nance

[permalink] [raw]
Subject: Re: Patch files

On Tue, Oct 02, 2001 at 02:25:12AM +1000, Anthony wrote:

> about the patch file so I might be able to understand how it works. Can
> anyone please explain (or point me to the relevant documentation) to me
> what the following lines mean?:
>
> --- linux/include/linux/pci_ids.h.netmos Sat Sep 8 09:44:43 2001
> +++ linux/include/linux/pci_ids.h Sat Sep 8 09:44:45 2001

This header tells you that the patch was generated by running:

diff -u linux/include/linux/pci_ids.h.netmos linux/include/linux/pci_ids.h

The original file is marked with --- and the new file is marked with +++

> @@ -1664,8 +1664,12 @@

This is used to seperate parts of the patch file. What it means exactly is
that the file position in the original file was at line 1664 and extended
for 8 lines, and in the new file its at line 1664 and extends for 12 lines.

> And this is from further down in the patch:
> @@ -2831,6 +2839,15 @@

Same as above. Lines 6 lines starting at 2831 in original file, and 15
lines starting at 2839 in the new file.

Hope this helps.

Thanks,

Jim