l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2001 Dec 30 16:58

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] diff/patch question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] diff/patch question


  • Subject: Re: [vox-tech] diff/patch question
  • From: jdnewmil@dcn.dMAPSavis.ca.us
  • Date: Thu, 02 Nov 2000 11:33:58 -0800
  • References: Pine.LNX.4.21.0011021100520.12898-100000@belial.ucdavis.edu

On Thu, 2 Nov 2000, Peter Jay Salzman wrote:

> i'm trying to patch a file 3dfx_driver.c.   the diff i'd like to use looks
> something like:
> 
>       --- 3dfx_driver.c       Sun Jan  9 09:15:29 2000
>       +++ 3dfx_driver.c.fix   Fri Jul 14 20:56:14 2000
>       @@ -703,25 +703,13 @@

>        #endif /* HAVE_MTRR */
>        
>        static struct file_operations fops_3dfx = {

The above part is the pre-context

>       -       NULL,                   /* llseek (2.1) / lseek (2.0) */
>       -       NULL,                   /* read */
>       -       NULL,                   /* write */

this means eliminate these lines

>       (etc)
> 
>       +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
>       +       owner:                  THIS_MODULE,
>        #endif
>       +       ioctl:                  ioctl_3dfx,             /* ioctl */
>       +       mmap:                   mmap_3dfx,              /* mmap */

add these lines

> 
> but every time i apply this with patch, i get an error message:
> 
>       # patch 3dfx_driver.c <diff
>       patching file `3dfx_driver.c'
>       Hunk #1 FAILED at 703.
>       1 out of 1 hunk FAILED -- saving rejects to 3dfx_driver.c.rej

differences are too major for the pre- and post-context to match up to let
the insertions/deletions take place.

> 
> i know there are different diff/patch formats, but i thought they were
> intelligent enough to detect the various versions.

I don't think this is a format problem.

> 
> i'm not really familiar with this format anyway -- i'm used to diffs looking
> something like
> 
>       2
>       < ehlo
>       ----
>       > hello
> 
> or something like that.  can someone help me with a suggestion on how to
> apply this patch?

By hand.  However, the fact that the files are different enough that the
patch won't take may mean you would be better off finding a newer
original than the one you have.

>   i'd do it by hand, but am confused by:
> 
>       +       owner:                  THIS_MODULE,
>        #endif
>       +       ioctl:                  ioctl_3dfx,             /* ioctl */
> 
> i'm not sure what the line without a + would mean.

unchanged text.  You should be able to find it in the original file.

>  i would think that lines
> beginning with - mean "take it out" and + means "put it in".

this is _supposed_ to be more people-friendly than the old diff format,
but it isn't a miracle in software. :)

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
Work:<JeffN@endecon.com>              Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.