Project

General

Profile

Actions

Bug #801

closed

bug in cvs using diff -p

Added by vs1 about 17 years ago. Updated about 17 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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.

  1. 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
    diff u -p -r1.16.2.1 md.c
    --
    md.c 31 Jul 2007 22:40:49 0000 1.16.2.1
    ++ md.c 4 Sep 2007 06:36:37 -0000
    @ -373,6 +373,8 @ DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_
    DEVSTAT_PRIORITY_OTHER);
    sc
    >dev = disk_create(sc->unit, &sc->disk, &md_ops);
    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.

  1. diff -u -p md.c md.c-manually_patched

--- md.c 2007-09-04 01:30:23.000000000 0500
++ md.c-manually_patched 2007-09-04 01:20:44.000000000 -0500
@ -373,6 +373,8 @ mdcreate(void)
DEVSTAT_PRIORITY_OTHER);
sc
>dev = disk_create(sc->unit, &sc->disk, &md_ops);
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

Actions #1

Updated by qhwt+dfly about 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.

Actions #2

Updated by corecode about 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

Actions

Also available in: Atom PDF