On Thu, 16 Mar 2000, Alexander Volovics wrote:
>This concerns Lyx-1.1.4 on a RedHat 6.1 system
>
>I installed Lyx-1.1.4 and applied patch-1.1.4fix1.
>So far so good. Everything seems to be working.
>
>When I try to apply patch-1.1.4fix2 I get the following
>output. As a non programmer I don't know what to make of
>these `Hunk's'. Can anybody please explain (also how to
>proceed if these `failures' are critical)

A "hunk" is a set of contiguous lines that are changed. Here is one
file-section of the e2compr patch, which I recently applied to the kernel as
distributed with Linux Mandrake, which has a few idiosyncrasies which forced me
to edit the patch:

diff -urN linux-2.2.14/fs/dquot.c linux-2.2.14-e2c0.4.36/fs/dquot.c
--- linux-2.2.14/fs/dquot.c
+++ linux-2.2.14-e2c0.4.36/fs/dquot.c
@@ -255,6 +255,7 @@
 {
 short type = dquot->dq_type;
 struct file *filp;
+struct inode *inode;
 mm_segment_t fs;
 loff_t offset;
 ssize_t ret;
@@ -277,9 +278,13 @@
  */
 dquot->dq_flags &= ~DQ_MOD;
 ret = 0;
-if (filp)
+if (filp) {
+inode = filp->f_dentry->d_inode;
+down(&inode->i_sem);
 ret = filp->f_op->write(filp, (char *)&dquot->dq_dqb, 
 sizeof(struct dqblk), &offset);
+up(&inode->i_sem);
+}
 if (ret != sizeof(struct dqblk))
 printk(KERN_WARNING "VFS: dquota write failed on dev %s\n",
 kdevname(dquot->dq_dev));

This consists of two hunks, each beginning with "@@". The lines beginning with
a space are context, those beginning with - are to be deleted, and those
beginning with + are added.

You should always dry-run a patch before actually applying it. That way, if you
apply the patch to the wrong version, or there is some inconsistency between
the patch and the files being patched, you won't trash the files.

phma

Reply via email to