Bug #801
closedbug in cvs using diff -p
0%
Description
Hi Matt.
I ended up manually patching this. It failed every time, using patch.
Luckily, in this case, it was just a simple 1 liner.
I finally tracked down the problem. I noticed you used cvs to create
the patch.
It is apparently a bug with cvs 1.12.13 on Dragonfly. I tested with cvs
1.11.20 on NetBSD and it worked properly, so it is apparently a bug cvs
has introduced in the newer version.
When using the -p option to diff when running under cvs, it outputs
a broken patch file. The problem is that it outputs the previous line
at the end of the '@@' line rather than the function name.
- cvs diff -u -p md.c
Index: md.c ===================================================================
RCS file: /home/dcvs/src/sys/dev/disk/md/md.c,v
retrieving revision 1.16.2.1
diffu -p -r1.16.2.1 md.cmd.c 31 Jul 2007 22:40:49
--0000 1.16.2.1>dev = disk_create(sc->unit, &sc->disk, &md_ops);
++ md.c 4 Sep 2007 06:36:37 -0000@ -373,6 +373,8
@ DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_
DEVSTAT_PRIORITY_OTHER);
sc
sc->dev->si_drv1 = sc;
sc->dev->si_iosize_max = DFLTPHYS;
+
return (sc);
}
========================
It worked properly with the same options using diff directly.
The output should look like this.
- diff -u -p md.c md.c-manually_patched
--- md.c 2007-09-04 01:30:23.000000000 0500>dev = disk_create(sc->unit, &sc->disk, &md_ops);
++ md.c-manually_patched 2007-09-04 01:20:44.000000000 -0500@ -373,6 +373,8
@ mdcreate(void)
DEVSTAT_PRIORITY_OTHER);
sc
sc->dev->si_drv1 = sc;
sc->dev->si_iosize_max = DFLTPHYS;
+
return (sc);
}
========================
Notice it shows the "mdcreate(void)" function at the end of the "@@"
line.
I noticed, on the cvs site, that 1.12.13 is not in the stable tree. You
might want to consider downgrading it to version 1.11.22 on Dragonfly,
which is the latest one I see in the stable branch.
Regards,
Vincent
Updated by qhwt+dfly over 17 years ago
JFYI, this works properly on DragonFly 1.8-RELEASE, or with cvs-1.12.13
installed from source on CentOS-4.5. So it must be more recent changes
that's causing it.
Cheers.
Updated by corecode over 17 years ago
I could reproduce it also in 1.8.1, so there must be some other cause.
Maybe it worked in 1.6. If you are absolutely sure that it works with
your 1.8, then it must be the compiler optimization, or just pure luck.
Anyways, it's fixed now.
cheers
simon